Computer Science Canada GUI help (with the 'include' statement) |
| Author: | mario64mario [ Sat Oct 25, 2008 8:22 am ] | ||||
| Post subject: | GUI help (with the 'include' statement) | ||||
Okay, so I've got three buttons made, and when each one is clicked, I want them to include other files, but whilst getting rid of the original three buttons. I used 'cls', but the buttons stay. Is there any other way to get rid of them other than GUI.Hide? ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Main window
"Browse Our Items" (example of the 'include' statement)
Turing displays the wall of text behind the three buttons. Can anyone help? Side Note: Sorry if the GUI construct is a bit messy. I learned it about 2 hours ago. |
|||||
| Author: | The_Bean [ Sat Oct 25, 2008 9:25 am ] | ||
| Post subject: | Re: GUI help (with the 'include' statement) | ||
GUI.Dispose will totally get rid of the buttons, but I don't think that this is what you want. I'm assuming you want GUI.Hide so that way the user can return to the menu and see those buttons again. The reason GUI.Hide isn't working for you is because you are recreating the buttons every time inside the loop, using exit when GUI.ProcessEvent will redraw every button that is not being hid at that time, so declare your buttons outside the loop. Then when you include something use GUI.Hide for the 3 buttons and they will out of sight.
|
|||
| Author: | mario64mario [ Sat Oct 25, 2008 10:15 am ] | ||||
| Post subject: | Re: GUI help (with the 'include' statement) | ||||
okay, I've put this in the 'browse.t' file
and I've declared the 'ReturnToMenu' procedure in the main program
I go and run it, and it opens the 'browse.t' and says that the procedure called 'ReturnToMenu' has not been declared. Any help? |
|||||
| Author: | The_Bean [ Sat Oct 25, 2008 10:55 am ] |
| Post subject: | Re: GUI help (with the 'include' statement) |
Declare it with the others and hide it at the start then when you enter the browsing option use GUI.Show on it. |
|
| Author: | mario64mario [ Sat Oct 25, 2008 11:34 am ] | ||||
| Post subject: | Re: GUI help (with the 'include' statement) | ||||
I did that. It doesn't show 'browse' or call upon 'button4' or 'ReturnToMenu' until the 'browse' button is clicked. Here's the updated program:
and the updated 'browse.t':
|
|||||
| Author: | The_Bean [ Sat Oct 25, 2008 2:03 pm ] | ||
| Post subject: | Re: GUI help (with the 'include' statement) | ||
Your problem is with View.Update. The GUI doesn't have View.Update built in with it, so when you click on it, the screen doesn't get updated with the animation, and your not updating the screen when you go to the include.
|
|||
| Author: | mario64mario [ Sat Oct 25, 2008 2:10 pm ] |
| Post subject: | Re: GUI help (with the 'include' statement) |
I ran it, and still got the same message >.> " 'ReturnToMenu' has not been declared " |
|
| Author: | The_Bean [ Sat Oct 25, 2008 2:13 pm ] |
| Post subject: | Re: GUI help (with the 'include' statement) |
returnToMenu is the first thing declared other than the variables, so that doesn't make sense. Did you copy and paste it into a new turing window? |
|
| Author: | mario64mario [ Sat Oct 25, 2008 2:22 pm ] | ||
| Post subject: | Re: GUI help (with the 'include' statement) | ||
okay, I got the thing to link proerly by taking out 'ReturnToMain' in it's entirety. Here's the new line of code:
It links propery, but when I go back to the main menu, it doesn't show the button for the area I just came from. If I click the area the button should be, then it goes there. EDITED: okay, I think the environment is just a bit glitchy. Thanks for the help, The_Bean ^_^ |
|||