Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Hiding button after using it
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
xsystem24




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Zren




PostPosted: 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




PostPosted: 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




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
xsystem24




PostPosted: 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




PostPosted: 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: