Computer Science Canada I can't click my button. |
Author: | doubleN [ Sat Jan 01, 2011 10:27 pm ] | ||
Post subject: | I can't click my button. | ||
What is it you are trying to achieve? This is an assignment my teacher gave me and my classmates are too busy celebrating new years to help me. It's just a guessing game program Also, I am in grade 9 computer science. What is the problem you are having? I have to add a button leading to the main menu of my program the display procedure. The button shows up, but I can't click on it. Any suggestions? I also need to exit the program or reset the limit when the user has 3 tries, but don't worry about that for now Anyway, I know there are some simpler ways to do some things, but I left my better code in class, and built upon the old stuff Describe what you have tried to solve this problem various loops and exit when statements, and I am clueless as to what I am to do Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) <Answer Here>
Please specify what version of Turing you are using 4.1.1 or something (please god don't let it be some obvious mistake) |
Author: | Tony [ Sat Jan 01, 2011 10:58 pm ] |
Post subject: | RE:I can\'t click my button. |
Quote: %I'm pretty sure that the problem is right here Yup, you have an infinite loop right above. It should never get into "display" until you "Quit" GUI and disable all the buttons. |
Author: | doubleN [ Sun Jan 02, 2011 1:38 pm ] |
Post subject: | Re: I can't click my button. |
Ah, but GUI.Quit is located in "userInput". The thing is , the main menu will send the user into "userInput", and then after the user has entered their guess, the loop exits, going into display. Also, by disabling the buttons, do you mean GUI.Dispose? Will that make the menu button in "display" work, if I disable all my other buttons? |
Author: | Tony [ Sun Jan 02, 2011 2:53 pm ] |
Post subject: | RE:I can\'t click my button. |
Please read GUI.ProcessEvent. Understanding of what this does should make it clear as to what the problem here is. |
Author: | doubleN [ Sun Jan 02, 2011 3:17 pm ] |
Post subject: | Re: I can't click my button. |
I guess I should have said that I tried putting the GUI.ProcessEvent in the loop already. What happens is that it goes straight to the goodbye procedure even if I click the menu button. Is there something I'm missing? |
Author: | Tony [ Sun Jan 02, 2011 3:56 pm ] |
Post subject: | RE:I can\'t click my button. |
Yes. Quote: The loop runs continuously until GUI.Quit is called, whereupon GUI.ProcessEvent will return true and the loop will exit. Edit: to be clear, once GUI.Quit is called, _any_ GUI.ProcessEvent will exit. The intention is that you drop all the way down and end the program. |
Author: | doubleN [ Sun Jan 02, 2011 4:07 pm ] | ||||
Post subject: | Re: I can't click my button. | ||||
But nowhere in my display procedure does it quit, so it should go to main menu. And if you're talking about the first loop, it does exit, in this code(userInput) The main Menu sends it here.
Here's my new Main Program
|
Author: | doubleN [ Sun Jan 02, 2011 4:11 pm ] |
Post subject: | Re: I can't click my button. |
Then again, the new main Program will send the user to display even if the user quits. Well, looks like I have to rewrite a lot of stuff here then. Edit: Okay then, I suppose I understand. If it has to just drop down and end, what I really need is a way for the program to continue from userInput to display. I can't call the display in userInput because display has to be declared first. I can't reverse their positions either because the main menu is in between these two procedures, and main menu calls userInput. What the heck do I do? |
Author: | doubleN [ Sun Jan 02, 2011 4:26 pm ] |
Post subject: | Re: I can't click my button. |
You probably won't see my upper post so bump |
Author: | Tony [ Sun Jan 02, 2011 5:07 pm ] | ||||
Post subject: | RE:I can\'t click my button. | ||||
GUI has to quit for the first loop to exit and to start the display procedure. At that point, GUI will no longer work. Think of other ways of exiting a loop, without calling Quit.
|
Author: | doubleN [ Mon Jan 03, 2011 8:38 pm ] |
Post subject: | Re: I can't click my button. |
Well, thanks for helping, I figured it out |
Author: | gtbgtb [ Tue Jan 04, 2011 2:03 pm ] |
Post subject: | RE:I can\'t click my button. |
Are you in Evil D's Class? Your prgramming style seems to be. Which class are you in? What period? |