
-----------------------------------
xsystem24
Sat Dec 21, 2013 12:12 pm

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:  :vi:  :canada:  :canada:

-----------------------------------
Zren
Sat Dec 21, 2013 1:29 pm

RE:Hiding button after using it
-----------------------------------
If you're never using it again, use [tdoc]GUI.Dispose[/tdoc]. If you're going to use it again, [tdoc]GUI.Hide[/tdoc]. You can always recreate the button if you dispose it.

-----------------------------------
xsystem24
Wed Dec 25, 2013 11:37 pm

Re: Hiding button after using it
-----------------------------------
Can u post the code?
I just want to see an example.

-----------------------------------
Tony
Thu Dec 26, 2013 12:19 am

RE:Hiding button after using it
-----------------------------------
There are examples in the documentation, that was linked in Zren's reply above.

-----------------------------------
xsystem24
Thu Dec 26, 2013 10:47 pm

Re: Hiding button after using it
-----------------------------------
I couldn't find an example for GUI.Hide

-----------------------------------
Tony
Fri Dec 27, 2013 1:05 am

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
[/code]
