Vizard 8 » Command Index » Vizard modules » viz » <viz>.addToggleButton
8.0

<viz>.addToggleButton

Add a toggle button label affixed by default to the screen

<viz>.addToggleButton(  
value  
group = ''  
scene = viz.MainScene  
parent = viz.SCREEN  
)  
value
A string to be displayed on the button
group = ''
If a non-empty string, then this specifies the toggle group to assign the button to. Only a single button within the same toggle group can be set at a time.
scene = viz.MainScene
If the parent is viz.WORLD or viz.SCREEN, then the argument represents the scene to add the object to.
If the parent is viz.ORTHO, then the argument represents the window to add the object to.
If the parent is a valid node3d object, then the argument is ignored.
parent = viz.SCREEN
viz.WORLD
viz.SCREEN
viz.ORTHO
<node3d> object

Remarks

A toggle button behaves similar to a checkbox or radio button, except it contains a text message.

Return Value

<node3d:GUI:buttonlabel> object

Example

Example 1:
toggle = viz.addToggleButton('Toggle Me',parent=viz.ORTHO,fontSize=20,pos=(100,100,0))

vizact.onbuttondown(toggle,viz.logNotice,'Toggle down')
vizact.onbuttonup(toggle,viz.logNotice,'Toggle up')

Example 2:
group = 'MyGroup'
option1 = viz.addToggleButton('Option 1', group, parent=viz.ORTHO,fontSize=18,pos=(100,50,0))
option2 = viz.addToggleButton('Option 2', group, parent=viz.ORTHO,fontSize=18,pos=(200,50,0))
option3 = viz.addToggleButton('Option 3', group, parent=viz.ORTHO,fontSize=18,pos=(300,50,0))

See also

<viz>.addButtonLabel
<viz>.addButton
<viz>.addCheckbox
<viz>.addDropList
<viz>.addProgressBar
<viz>.addRadioButton
<viz>.addSlider
<viz>.addText
<viz>.addTextbox