WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 06-22-2016, 11:07 AM
Eugene Eugene is offline
Join Date: Jun 2016
Posts: 6
Change the color of button

I've created a few panels with different buttons. One of them shown below. I would like to change the button color when selected for specific panel to another color. May I know how could I do it?

For example, I would like PrimeOffButton.set(1) to be red instead of default color.

PrimeOffButton = viz.addButtonLabel('Off')
PrimeKeepAliveButton = viz.addButtonLabel('Keep-Alive')
PrimeOperationalButton = viz.addButtonLabel('Operational')
subpanel2.addItem(viz.addText('SSRMS Prime String'))

Reply With Quote
Old 06-23-2016, 05:25 AM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,471
You can set the GUI theme globally, for an individual GUI element, or for a GUI container that contains the button. The example script in this thread shows how changing various theme properties affects a menu and info panel:

import viz
import vizinfo

theme = viz.getTheme()
theme.highBackColor = (1,0,0,1)

button = viz.addButtonLabel('Off',pos=[0.2,0.95,1])

infoPanel = vizinfo.InfoPanel('Panel')
panelbutton = infoPanel.addItem(viz.addButtonLabel('Off'))
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to map HTML button to Transport in Vizconnect JB_HP_Viz Vizard 3 02-24-2015 07:38 PM
Push a button snoopy78 Vizard 1 07-20-2009 09:39 AM
Create Button or Text Chrissy2009 Vizard 1 07-15-2009 05:34 PM
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 12:14 PM
button problems cade_mccall Vizard 3 02-22-2007 09:48 AM

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

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