![]() |
Pyforms - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: Pyforms (/thread-14278.html) |
Pyforms - Jemeronimo - Nov-22-2018 Hey guys! With Pyforms I'm trying to make the following First row: 2 sliders that can have values from 0-10 Second row: 2 graphs that react to the values put in in the sliders, for example y=e^x and y=x^x Last row: Another 2 graphs I have been trying to make this for a while and don't know if pyforms is the best option. I can't find how to connect these values I get from the sliders and how to make these graphs in pyforms. If someone could help me that would be great. this is my code so far: from pyforms.basewidget import BaseWidget from pyforms.controls import ControlFile from pyforms.controls import ControlText from pyforms.controls import ControlSlider from pyforms.controls import ControlPlayer from pyforms.controls import ControlButton class ComputerVisionAlgorithm(BaseWidget): def __init__(self, *args, **kwargs): super().__init__('Computer vision algorithm example') #Definition of the forms fields self._slider1 = ControlSlider('some t', default=100, minimum=0, maximum=200) self._slider2 = ControlSlider('some x ', default=100, minimum=0, maximum=200) #Here I want to have 4 graphs in a 2 by 2 forms # self.graph1 = # self.graph2 = # self.FTrasnfor1 = # self.FTransfor2 = #Define the organization of the Form Controls self._formset = [ ('_slider1', '_slider2') ] def __process_frame(self, frame): """ Do some processing to the frame and return the result frame """ return frame def run_event(self): """ After setting the best parameters run the full algorithm """ print("The function was executed", self._videofile.value) if __name__ == '__main__': from pyforms import start_app start_app(ComputerVisionAlgorithm) |