View Full Version : Slider with 2 labels
Hey guys,
I am trying to make a slider that has 2 labels, like this:
Very uncertain -------------------[]---- Very certain
I am using vizinfo, but I don't think this is an option. Anyone has a suggestion how to do it in an elegant way? Thank you!
Are you using the vizinfo panel for other GUI elements or just the slider and text? Panels from the vizdlg (http://docs.worldviz.com/vizard/#Vizdlg_introduction.htm) library support custom GUI layouts.
I am using it for other elements, too. It would be kind of a weird switch to use vizdlg just for the slider i think...
You can customize a vizinfo panel by adding vizdlg panels to it:
import viz
import vizinfo
import vizdlg
viz.go()
dojo = viz.addChild('dojo.osgb')
info = vizinfo.InfoPanel('InfoPanel with custom layout')
info.addSeparator()
textbox1 = info.addLabelItem('text box 1',viz.addTextbox())
textbox2 = info.addLabelItem('text box 2',viz.addTextbox())
info.addSection('vizdlg sub-panel with 3 elements in a row')
row = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_BOTTOM,back ground=False,border=False)
text1 = row.addItem(viz.addText('Very uncertain'))
slider = row.addItem(viz.addSlider())
text2 = row.addItem(viz.addText('Very certain'))
info.addItem(row)
vBulletin® v3.8.7, Copyright ©2000-2025, vBulletin Solutions, Inc.