Thread: Drop Down menu
View Single Post
Old 06-08-2016, 08:50 AM
M@rcello M@rcello is offline
Join Date: May 2016
Posts: 11
Question Drop Down menu

Hello to everyone,
I am trying to build a drop down menu in vizard.
This is the code:
HTML Code:
import viz
import vizdlg


#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' ) 
In the menu i can set the color and size of the ball. I would like to have a button to confirm the properties and insert immediately a ball with that color and size.

Thanks in advance!
Reply With Quote