UI Elements Passing Data - Documentaiton?

UI Elements Passing Data - Documentaiton?

AronDurkin
Enthusiast Enthusiast
240 Views
1 Reply
Message 1 of 2

UI Elements Passing Data - Documentaiton?

AronDurkin
Enthusiast
Enthusiast

Some UI elements pass actually useful data, like this example of "TextFieldButtonGroup" "textChangedCommand" passing the value, which makes sense.

 

BUT! Where the is this in the docs? Where can i see what UI elements pass what, if any? Is this mentioned anywhere? I've only just discovered this and it seems kinda useful!

 

Fd5KsEcXoAEKUQD.png

0 Likes
241 Views
1 Reply
Reply (1)
Message 2 of 2

Kahylan
Advisor
Advisor

Hi!

 

I don't think there is a good documentation on this, or atleast I haven't found it...

 

As a rule of thumb:

Most Fields pass the value entered

Most Buttons pass True or False

Most state buttons (radio, checkbox) have an on command (True) and off command (False)

Script Elements pass the script entered.

 

I made a habit out of just querying the output first whenever I use a UI element I'm not familiar with, this way:

# If one value is passed

#command
lambda x: output(x)
#function
def output(x):
    print("Printed: {0}".format(x))

#if no value is passed
#command
outputFree
#function
def outputFree():
    print("I ran therefore no args were passed")

#If multiple arguments are passed
#command
lambda *x: multiOutput(*x)
#function
def multiOutput(*args):
    print(args)

One of these three will work and tell you what the passed argument was.

 

I don't do a lot of UI scripting but the UI elements I most often use and therefore wrote down at some point pass the following arguements:

button -> False
symbolButton -> False
iconTextButton -> Nothing is passed
textfield -> tx
intfield -> v

radioButtonGrp -> cc= True, on = True, of = False
radioButton -> cc= True, onc = True, ofc = False

checkBoxGrp -> cc= True, on = True, of = False
checkBox -> cc= True, onc = True, ofc = False


intSlider -> v
colorIndexSliderGrp -> dc = Nothing is passed

scriptTable -> (tableRowIndex, tableColumnIndex, cellValue) (int,int,string)

 This list is far from complete ofcourse, but it's a startingpoint at least^^

 

I hope it helps!

0 Likes