Click the button to access a page (python)
Dj
-
xHaMaz Posted messages 123 Registration date Status Member Last intervention -
xHaMaz Posted messages 123 Registration date Status Member Last intervention -
Hello,
I am a beginner, I would like to understand how to click on a button (created with a rectangle function) for example play to enter another page I use the FLTK module
rectangle (...,tag='b')
ev= donne_ev
tev=type_ev()
If tev=='ClicGauche' in 'b':
-To display another page
And afterward I don't know what to do, please help me, I need it for a project.
1 answer
Good evening, first create a function that will allow you to display the new page you want:
def display_page_2(): # Code to display page 2 here Then in the function that handles clicks, check if your click occurred by verifying if the object "tev" is equal to "LeftClick" and if the tag of the object "ev" is equal to "b" and if so, call the function that displays the new page. Example:
if tev == "LeftClick" and ev.tag == "b": display_page_2() Let me know