Vizard 7 » Reference » Graphical user interfaces (GUIs) » GUI elements » GUI appearance
7.7

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 New Roman') 

Changing the color themes

To change the colors of text, background, and borders of GUIs, set their themes. This works for certain GUI elements (progress bars and droplists) and GUI containters (vizmenu, vizdlg, and vizinfo). The themeExample.py script (File > Quick Open > type: themeExample) shows how changing various theme properties affects a menu and info panel.

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