I am including a Rackspace with a ScriptLet to demonstrate my questions.
Both Green_Button and Green_Button_Label are Scriptlet parameters. I wish to set them to selected and “DISABLED” respectively. I try to do this in the Initialization Code … which doesn’t seem to fully work. IE: the button stays as is and the label changes but then goes invisible.
So, my questions are:
Initialization - even though I set Green_Button to 0.00000, it still remains enabled or in the selected state, why?
ParameterValueChanged callback- when I set the Green_Button_Label to “ENABLED” or “DISABLED” based on Green_Button’s value, it changes for a moment and then disappears, why?
Plz take a look at the Scriptlet and tell me what I am doing wrong?
When you leave it blank and you turn ‘customize caption’ off, it will display the parameter it is bound to and temporarily show the value when it changes. When you turn ‘customize caption’ on, you overrides it (except from the temporary value, that’s where hide temporary value comes in). When you leave it blank, it stays blank, because you’ve overridden it. When you enter [value] then the value is displayed (what you wanted). [value] acts like a sort of macro. You can put extra text in the box for instance ‘and the value of my big green button is [value]’
Now it’s working…
I removed the unneeded variable definitions in the rackspace script, then i changed the widget properties (see screenshot) and i chanegd the scriptlet’s code a bit.
I think there is no need for an initialization routine here, since you already initialized the parameters by definition, i also changed the the testing for ==1.0 to >0.6
Before i always had to press the button multiple times until it really behaved as expected… strange.
I think Gig Performer is having problems with my Gig File because if I exit GP and then come back in, the Rackspace works. I will research this further.
Can you describe what exactly the issue is, or what exactly is happening and when?
From what i can tell at the moment, you managed to export the rackspace from your last posting in a widget state where the button is OFF but the label is “ENABLED”, which is an exception that shouldn’t exist (GP saves the widgets states as they are and recalls them on load).
This paradoxic widget state can only be created if you switch the button to OFF and then (why ever) manually change the label-parameter to “ENABLED”, which can be done because the script only uses a callback parameter for changes from “Green_Button”… and this isn’t altered at that moment.
So what happens then is the following:
Rackspace is imported with Button = OFF and Label = ON
→ Button = OFF (per variable definition) → no button-parameter change → Label = ON
→ Press the button → button-parameter changes (from 0 to 1) → Label = ON
So the first click will have no effect on the label, since it is already ON.
After that the function will work as expected.
I tried to re-activate the Initialization routine to set the button and the label to OFF when the rackspace is loaded, but strangely this had no effect.
What worked then to have both widgets started in OFF state (if that’s what you want?), was to use the “On Activate” routine to set the parameters to 0
But this would happen every time you switch to that rackspace… don’t know if that’d be ok for your use case.
// Called when rackspace is activated
On Activate
Green_Button = 0.0
Green_Button_Label = "DISABLED"
End
On activate is definitely not what I want as I use this technique in a much more sophisticated Rackspace. However, your technique works fine now … as I am not sure what I was doing wrong … but in the course of my development and testing, GP has locked up many times. I attribute this to my funky coding. So, thanks for your help, it did solve my problem.
I will be pushing my Rackspace soon for you to check out. It is a highly advanced version of your initial DIVISI design Rackspace. I know you will love it when I get it finished. Thanks for inspiration