Reference: GUIs

GUI appearance

Adding textures to GUI elements

To set the texture that appears when a button or checkbox is selected or unselected, use <button or checkbox>.downpicture( <texture> ) or <button or checkbox>.uppicture(<texture>), respectively. You can also apply a texture to the tick or bar on a slider.

 

#Add a slider.
mySlider = viz.addSlider()
mySlider.setPosition(.5,.25)
mySlider.ticksize(4,3)
#Give the tick a new texture.
mySlider.tickpicture('vizinfo.tif')

#Add a checkbox.
myCheckBox = viz.addCheckbox()
myCheckBox.setPosition(.5,.75)
#Give it textures for when it's selected and unselected.
myCheckBox.uppicture('play.tif')
myCheckBox.downpicture('pause.tif')

Fonts

To change the font of any of your GUI elements, just use <GUI element>.font(<font filename>. Vizard will look inside the Windows/Font directory when setting a font. You can browse that directory to see what fonts are available on your system.

 

#Add a progress bar and choose its font.
myProgressBar = viz.addProgressBar('How is it going?')
myProgressBar.setPosition(.5,.5)
myProgressBar.font('times.ttf')

Changing the color themes

To change colors of the text, background, and borders of your GUIs  (specifically progress bars, droplists, and menus created with vizmenu and panels created with vizdlg), you can set their themes. Take a look at this vizmenu script for an example of this.  

 

See also

In this section:

User interface basics

GUI elements

Getting data from GUI elements

GUI appearance

vizinfo

vizmenu

vizinput

vizdlg

vizconfig

viztip

Displaying HTML

GUI command table

Other sections:

Event Basics

Action basics

Text node basics

Example scripts:

vizInfo

vizMenu

Prompt