Vizard 7 » Reference » Graphical user interfaces (GUIs) » Organizing GUIs » vizmenu
7.7

Making pop-downs with vizmenu

To create pop-down menus, use Vizard's vizmenu module and then fill those menus with any of Vizard's GUI elements (sliders, buttons, dropdown lists, text boxes, etc.). You can also nest pop-down menus within your main pop-downs to create expanding menus.  Here's the basic process for creating a pop-down menu:

#Create main menu object
import vizmenu
menu = vizmenu.add()
#Align the menu in the enter of the top of the screen.
menu.setAlignment( vizmenu.CENTER )
#Add two pop-downs menus within the main menu.
AppearanceMenu = menu.add( 'Appearance' )
Ball1Menu = menu.add( 'Ball 1' )

#Add a droplist to one of the pop-downs.
themeDropDown = AppearanceMenu.add( viz.DROPLIST, 'Theme' )
themeDropDown.addItems( ['Default','Dark','Green'] )

#Add sub-menu under the Ball1 menu and put radio buttons in it.
Ball1ColorMenu = Ball1Menu.add( vizmenu.MENU, 'Color' )
Ball1Red = Ball1ColorMenu.add( viz.RADIO, 0, 'Red' )
Ball1White = Ball1ColorMenu.add( viz.RADIO, 0, 'White' )
Ball1Blue = Ball1ColorMenu.add( viz.RADIO, 0, 'Blue' )
#Add another sub-menu to the Ball1 menu for a slider.
Ball1SizeSlider = Ball1Menu.add( viz.SLIDER, 'Size' )

To change the appearance of your pop-downs (the color theme, fonts, etc.), check out the section on GUI appearance. To learn how to get the user responses from the elements in the pop-down menu, check out the section on getting data from GUI elements.

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