Computer Science Canada

Hiding button after using it

Author:  xsystem24 [ Sat Dec 21, 2013 12:12 pm ]
Post subject:  Hiding button after using it

* What is it you are trying to achieve?
When the user click on a button, the button do the function then it disappear and hide

* What is the problem you are having?
Trying to hide the button after using it.

* Describe what you have tried to solve this problem
Spent hours and no solution

* Please specify what version of Turing you are using
4.1.1

Canada Canada BooHoo Canada Canada

Author:  Zren [ Sat Dec 21, 2013 1:29 pm ]
Post subject:  RE:Hiding button after using it

If you're never using it again, use GUI.Dispose. If you're going to use it again, GUI.Hide. You can always recreate the button if you dispose it.

Author:  xsystem24 [ Wed Dec 25, 2013 11:37 pm ]
Post subject:  Re: Hiding button after using it

Can u post the code?
I just want to see an example.

Author:  Tony [ Thu Dec 26, 2013 12:19 am ]
Post subject:  RE:Hiding button after using it

There are examples in the documentation, that was linked in Zren's reply above.

Author:  xsystem24 [ Thu Dec 26, 2013 10:47 pm ]
Post subject:  Re: Hiding button after using it

I couldn't find an example for GUI.Hide

Author:  Tony [ Fri Dec 27, 2013 1:05 am ]
Post subject:  RE:Hiding button after using it

you already have an example for Dispose
code:

import GUI in "%oot/lib/GUI"
View.Set ("graphics:150;100")

var button : int

button := GUI.CreateButton (20, 40, 0, "Quit", GUI.Quit)

loop
    GUI.Hide (button)
    exit when GUI.ProcessEvent
    delay(2000)

    GUI.Show (button)
    exit when GUI.ProcessEvent
    delay(2000)
end loop


: