Variation name as caption text in rack panel?

How can I have a variation name as text in rackspace panel (different text for each variation under same rackspace)?

I know I can use [value] to display value as caption - is there something as [variation_name] to show caption of variation name?

tnx

Hi @danijell and welcome to our community!
You can only do this by using a small snippet of GPScriptā€¦ and the script has to be in each rackspace!

First, place a Textlabel widget onto your rackspace panel, then give it a name for the use in GPScript.
You can do this on the ā€œAdvancedā€ tab of a widget when in edit mode.
2021-05-07 23_57_48-Window
In my script i used the name ā€˜lblVariationNameā€™ (you can use any name you want, but youā€™ll have to use the same name in the script then).
Now open the script editor: menu ā†’ window ā†’ script editor
Then C&P this code into the editor and press the ā€œCompileā€ button. After that the script should work.

var
lblVariationName : widget

// Called once when rackspace is first loaded
Initialization
    SetWidgetLabel(lblVariationName, GetVariationName(GetCurrentVariation()))
End

// Called when you switch variations
On Variation(oldVariation : integer, newVariation : integer)
    SetWidgetLabel(lblVariationName, GetVariationName(newVariation))
End

ā€¦hope it helps.
If you have questions, donā€™t hesitate to ask! :slight_smile: :beers:

EDIT: I added some code, so the script will not only catch the variationā€™s name when a variation is actually changed, but also at the start of the program.

Cheers
Erik

5 Likes

Erik,

tnx for a welcome note - Iā€™ve been trying GigPerformer for a few weeks - and decided I can get rid off my HW gear :smiley:

tnx a million for script - it works like a charm :slight_smile:

looking fwd to get to the point I can help newcomers.

keep safeā€¦
Danijel

8 Likes