WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Drop Down menu (https://forum.worldviz.com/showthread.php?t=5742)

M@rcello 06-08-2016 08:50 AM

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

viz.go()

#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!

Jeff 06-14-2016 03:45 AM

You could add a button or button label:

Code:

button = Ball1Menu.add(viz.BUTTON,'Submit')
button.setScale([2]*3)
buttonLabel = Ball1Menu.add(viz.BUTTON_LABEL,'Submit')



All times are GMT -7. The time now is 07:32 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC