Basic GUI questions

Can I change the color of GUI elements like buttons and sliders?

Is the proportion of sliders adjustable?
http://www.door3.org/ExtraPart.jpg
I would like to have more slider and less blank space in some places.

Is it possible to have the slider value update as the slider moves instead of only after release?

Can I make a vertical slider?

no, no, yes and no, in that order :wink:

to make the slider update when dragging, change the Update argument to 1 instead of 0 (it’s the argument just before the tooltip, if I remember correctly).

Martin

Crap,crap,cool and crap :wink:

Thanks Martin

Hmmm, that does not seem to be working. I will play with it some more

that’s what the docstring of the function says:

(name, event, x, y, width, height, initial, min, max, [update, tooltip]) - Create a new Slider button

(name) A string to display on the button
(event) The event number to pass to the button event function when activated
(x, y) The lower left coordinate of the button
(width, height) The button width and height
(initial, min, max) Three values (int or float) specifying the initial and limit
values.
[update=1] A value controlling whether the slider will emit events as it is edited.
A non-zero value (default) enables the events. A zero value supresses them.
[tooltip=] The button’s tooltip

AFAIR, all this works as it’s suppose to.

Martin

can’t you go into the source code of blender itself (seeming it’s open source)? That way you can have verticle colourful sliders in every home!

I wouldn’t like to be restricted this way…

Could someone run this simple script, and offer any thoughts on what I am missing on this “Emit” value, It does not work on my machine…

#Posted on Elysiun Forum to ask "Data Emmision question"
#6/1/2003
#Door3_C. Cowen


#import Blender
from Blender.Draw import *
from Blender.BGL import *

Ttext = "What defines text color and font?"
Text (Ttext)

def Section():
	global Tscroll
	global xTscroll

    	glClearColor(.7 , .27, .188, 10)
	glClear(GL_COLOR_BUFFER_BIT)
    	glRasterPos2i(50, Tscroll.val)
    	Text (Ttext)

	Button("Exit", 1, Tscroll.val, 10, 80,20)
	Tscroll = Slider('3 ',2, 100,  100, 500, 20, Tscroll.val, 2, 500, 0, "Changing the 0 to 1 in this line should cause the data to emit?")
##############################################
#The last value before the tool tip text should be 0 or 1 to emit yes or no
##############################################
	Button("Other Button", 1, 150, 100, 180,20)


Tscroll = Create(50)

def SecondEvent(evt, val):	
	if (evt== ESCKEY and not val): Exit()

def bevent(evt):
	if   (evt== 1): Exit()
	elif (evt== 2): Draw()

Register(Section, SecondEvent, bevent)

Edit:
I don’t know why but the indentation on gl clearcolor,glrasterpos and Text is not formatting right here. You may have to adjust those indents to run this. Funny, it formats right in this edit screen and wrong on the forum posting…