|
jtviper456 Novice
Joined: 17 Jan 2003 Posts: 37
|
Posted: Fri Sep 26, 2008 4:22 am
Alias Update Toggle Button? |
Is there any way to make a button update automatically after firing off an alias that changes variables?
|
|
|
|
Dyron Apprentice
Joined: 08 Apr 2004 Posts: 103 Location: USA
|
Posted: Fri Sep 26, 2008 4:39 am |
Hrmm.. need more details on what you mean
|
|
|
|
jtviper456 Novice
Joined: 17 Jan 2003 Posts: 37
|
Posted: Fri Sep 26, 2008 4:52 am |
I've got a Toggle button...that toggles variable 1
So, I push the button down, Variable A is changed to the value 1...release the button, and Variable A is changed to 0....
I also have an alias that changes Variable A to 1, but the button state won't change when the alias changes the variable! |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Fri Sep 26, 2008 3:45 pm |
The solution is to check if the button is already toggled, (in state 1) and then if it isn't use the #BUTTON [id] in the alias to make the alias "click" the button.
Example Code:
Code: |
#CLASS {ButtonStateExample}
#ALIAS DoButton {#IF (@BtnState = 0) {#BUTTON StateTestBtn}}
#VAR BtnState {1}
#BUTTON 1 {Up} {#ECHO I've just Released My Toggled} {Down} {#ECHO I've just Engaged My Toggled} {} {BtnState} {} {} {} {} {} {} {} {} {} {} {} "" {} {} {StateTestBtn}
#CLASS 0 |
Then when you do the alias, if the button is already "On" it ignores the alias, if it is "Off" it performs the button and thus sets the value to 1. |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
|
|