[Bf-python] Slider Button API

Joe Eagar joeedh at gmail.com
Thu Apr 12 06:24:31 CEST 2007


Dave Jarvis wrote:
> Hi,
>
> After I have created a Slider Button using:
>
>    slider = Draw.Slider( ... )
>
> How do I then change the minimum and maximum values for the slider?
>
> I thought I could do the following (initial, min, max):
>
>    slider.val = (1.0, 0.0, 100.0)
>
> Or even:
>
>    slider.min = 0.0
>    slider.max = 100.0
>    slider.val = 1.0
You have to understand how blender's UI code works.  It's really odd, 
but the UI is completely re-created on each redraw.  So after each draw, 
your slider will be re-created.  So doing something like Draw.Draw() to 
update the slider should work.

Note this may (please god!) change in the future :)

Joe



More information about the Bf-python mailing list