This is a very hard issue to explain, but hopefully someone knows what I'm talking about. This is either a major bug or a simple flaw in my code.
If you want to try this for yourself, or view the code
pastebin get 7UHGc1tu demo
I have a program that has multiple pages, and a button that is in the exact same position on both pages. The issue is when I press the button on one page, which triggers an event then switches to the second page, it triggers the first event but also part of the second event. I have setup a sample program to demonstrate this issue. The program is supposed to display "Event 1" if the button on Page 1 is pressed, and display "Event 2" if the button on page 2 is pressed. Pressing the button on page 1 will also switch the page to page 2 where an identical button is. The button on page 2 will trigger the second event and switch back to page 1.
What ends up happening is "Event 1" is triggered, but when the program switches to page 2, it detects the press for a second time even though it was only clicked once. The odd part is that it doesn't display "Event 2" but it does switch the page back to page 1.
I feel like I'm not being followed, so here is a gif of the sample program and explanation of the program.
The X represents the amount of times page 1 has been drawn. The program should switch to page 2, instead it acts like it switched to page 2, switched back to page 1 because of the button press, but didn't display "Event 2".
The basic conclusion is that it toggles the buttons on both pages, but only sets the variable on page 2 and doesn't display "Event 2". Ideally it would only display "Event 1" and switch to page 2 on a single press.
I know this is basically impossible to follow but if you have any insight about anything, I would appreciate the help! If you would like me to explain anything further or clarify anything, let me know! Thanks!
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
This is a very hard issue to explain, but hopefully someone knows what I'm talking about. This is either a major bug or a simple flaw in my code.
If you want to try this for yourself, or view the code
pastebin get 7UHGc1tu demo
I have a program that has multiple pages, and a button that is in the exact same position on both pages. The issue is when I press the button on one page, which triggers an event then switches to the second page, it triggers the first event but also part of the second event. I have setup a sample program to demonstrate this issue. The program is supposed to display "Event 1" if the button on Page 1 is pressed, and display "Event 2" if the button on page 2 is pressed. Pressing the button on page 1 will also switch the page to page 2 where an identical button is. The button on page 2 will trigger the second event and switch back to page 1.
What ends up happening is "Event 1" is triggered, but when the program switches to page 2, it detects the press for a second time even though it was only clicked once. The odd part is that it doesn't display "Event 2" but it does switch the page back to page 1.
I feel like I'm not being followed, so here is a gif of the sample program and explanation of the program.
The X represents the amount of times page 1 has been drawn. The program should switch to page 2, instead it acts like it switched to page 2, switched back to page 1 because of the button press, but didn't display "Event 2".
What Page 2 would look like after 1 button press:
https://imgur.com/a/wbIMjmF
The basic conclusion is that it toggles the buttons on both pages, but only sets the variable on page 2 and doesn't display "Event 2". Ideally it would only display "Event 1" and switch to page 2 on a single press.
I know this is basically impossible to follow but if you have any insight about anything, I would appreciate the help! If you would like me to explain anything further or clarify anything, let me know! Thanks!
Link to post
Share on other sites