Author |
Message |
xsystem24
|
Posted: 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
 |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Zren

|
Posted: 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. |
|
|
|
|
 |
xsystem24
|
Posted: 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. |
|
|
|
|
 |
Tony

|
Posted: 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. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
xsystem24
|
Posted: Thu Dec 26, 2013 10:47 pm Post subject: Re: Hiding button after using it |
|
|
I couldn't find an example for GUI.Hide |
|
|
|
|
 |
Tony

|
Posted: 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
|
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
|