[Bf-committers] UiDefButF - setting the default value?

Alexander Ewering blender at instinctive.de
Wed Oct 11 18:51:32 CEST 2006

On Wed, 11 Oct 2006, Tom M wrote:

> Anyone know how to set the default value for uiDefButF ?
> in the UI docs in Doc folder of CVS it explains, min, max, and
> increment, but nothing about how defaults are set (that I see
> anyway...)
> uiDefButF(block, NUM, B_TEXPRV, "Scale :",	10, 110, 150, 19,
> &tex->noisesize, -20.0, 20.0, 100, 0, "Sets scaling for noise input");

Hi Letterrip :)

It uses whatever is stored initially in the variable pointed to. You need to
initialize the variable yourself elsewhere. SDNA initializes new variables
to 0 by default. You could check that right before creating the button, and
then assign your own default if it's 0. However, if 0 is a legitimate value,
that of course doesn't work. Then, you'd need to dive into do_versions()...

| alexander ewering              instinctive mediaworks
| ae[@]instinctive[.]de   http://www[.]instinctive[.]de

More information about the Bf-committers mailing list