Home » Community » Newbie corner » Question on a widget on top of a widget **BUG STATEMENTS NOT COMPLETED BEFORE NEXT STATEMENT
Re: Question on a widget on top of a widget [message #33294 is a reply to message #33293] |
Fri, 22 July 2011 23:07 |
|
silverx wrote on Fri, 22 July 2011 21:38 | It appears that the code to do things stop working when I have Sleep(x) after the command.
Things are not processed in order, and continue with the next command after the previous command is completed.
To me this is a bug in the system. It should complete the previous command before starting the next command.
Any way to force a commands to complete before starting the next command in the program?
David
|
Yes this is one of the problems. It is not a bug, it works exactly as intended. Sleep just sleeps, halting all the code execution. To force the changes to be drawn to screen, you can call Sync() method, which causes all the areas marked to be refreshed to be redrawn.
The second thing is that overriding the Paint() method seems like an overkill, at least in the example code you sent. You are using SetImage to cover the entire area of button, so the changes you did to the painting routine are not visible anyway. And if I understood it correctly the only intention was to hide the borders, which can be achieved in simpler way just by calling Hide() in constructor and Show() when starting the quiz
Honza
|
|
|
Goto Forum:
Current Time: Sun Jun 16 01:38:49 CEST 2024
Total time taken to generate the page: 0.02245 seconds
|