Computer Science Canada Help With Clock |
Author: | supallama [ Sun Oct 02, 2011 2:02 pm ] | ||
Post subject: | Help With Clock | ||
What is it you are trying to achieve? I am trying to create a clock that has an alarm What is the problem you are having? the GUI buttons do not work Describe what you have tried to solve this problem Googled the answer Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) no relevent code aside from the whole thing
Please specify what version of Turing you are using Turing 4.1.1 |
Author: | Tony [ Sun Oct 02, 2011 2:15 pm ] |
Post subject: | RE:Help With Clock |
GUI buttons "work" only during the moment that GUI.ProcessEvent line is being called. Which, in your program, is precisely never. |
Author: | supallama [ Sun Oct 02, 2011 2:15 pm ] |
Post subject: | RE:Help With Clock |
**ADDITIONAL INFORMATION** -The clock is supposed to get the time from the user and then play good morning by the beatles and continue moving -The clock is also supposed to play a tick noise while moving - I was hoping to put 12, 3, 6, and 9 on the face of the clock, or outside of the clock but that was somthing I would have gotten to after the GUI buttons |
Author: | supallama [ Sun Oct 02, 2011 2:28 pm ] |
Post subject: | RE:Help With Clock |
OK, so I have moved GUI.ProcessEent from the main program loop to just underneath GUI.Refresh near the bottom of the displayClock procedure and it makes it active, but the words "please set alarm" are not revealed unless I close the running window |
Author: | Tony [ Sun Oct 02, 2011 3:08 pm ] |
Post subject: | RE:Help With Clock |
Take a few guesses as to why you might not be able to see those words. |
Author: | supallama [ Sun Oct 02, 2011 8:35 pm ] |
Post subject: | RE:Help With Clock |
tell ya the truth I have no idea, I am a newbie at this |
Author: | Tony [ Sun Oct 02, 2011 9:05 pm ] | ||
Post subject: | RE:Help With Clock | ||
The very first step to approaching this problem is to confirm that this code even runs. We can't see the output on the screen, but we could do other things... e.g. we could try writing to a file. Though since we just want a yes/no answer here, we could throw an exception
This confirms that the code actually runs. Good. This leaves you with two options: - the text is drawn and then quickly erased (unlikely; proof left as an exercise for the student) - the text is drawn but the screen is not updated |