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).
(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
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…