Computer Science Canada Disabling Buttons After Use |
Author: | Sty1ez [ Tue Jan 22, 2008 5:04 pm ] |
Post subject: | Disabling Buttons After Use |
Im kinda still a newbie to turing ...... I wanted to know how to disable a button after it is pressed since you can't put the disable button command in the procedure itself. What im asking.. is there an alternate way of disabling a button since the disable command has to be after the button is created and the procedure comes before the button. |
Author: | Gooie [ Tue Jan 22, 2008 5:27 pm ] | ||
Post subject: | Re: Disabling Buttons After Use | ||
Use an array of boolean. Similarly to input. Set all the values to true with a for loop, and as the conditions are met set the key to false. There is probably a more elegant way of doing this. Just an Example.
|
Author: | Sty1ez [ Tue Jan 22, 2008 5:36 pm ] |
Post subject: | Re: Disabling Buttons After Use |
I dont understand arrays yet and I was talking about a ------>GUI.CreateButton<------- not a key on your keyboard |
Author: | Gooie [ Tue Jan 22, 2008 5:38 pm ] |
Post subject: | Re: Disabling Buttons After Use |
Sty1ez @ January 22nd, 5:36 pm wrote: I dont understand arrays yet
and I was talking about a ------>GUI.CreateButton<------- not a key on your keyboard Ah I see, I avoided GUI, sorry I can't help you there. |
Author: | ericfourfour [ Tue Jan 22, 2008 5:58 pm ] |
Post subject: | RE:Disabling Buttons After Use |
Styles you should learn arrays before you move to any GUI. I don't really understand what you are asking. Maybe if you posted some pseudo-code to show what you are attempting, you can get better help. |
Author: | HeavenAgain [ Tue Jan 22, 2008 6:09 pm ] | ||
Post subject: | RE:Disabling Buttons After Use | ||
you cannot disable something when its not there, so im not sure why are you trying to disable your button before it even existed.... and for disabling button, you can just simply do something like
|
Author: | Nick [ Tue Jan 22, 2008 6:10 pm ] | ||
Post subject: | RE:Disabling Buttons After Use | ||
how about a boolean varible set to true when activated so...
|
Author: | Clayton [ Tue Jan 22, 2008 6:37 pm ] |
Post subject: | RE:Disabling Buttons After Use |
Since Turing's built in GUI uses action procedures, you can simply have your GUI.Disable() as the first line in your procedure so that you don't have need for a silly boolean variable to keep track of as well. |