[gtkada] Spinbuttons
Emmanuel Briot
briot at gnat.com
Thu Jan 25 12:54:37 CET 2001
manuel.op.de.coul at eon-benelux.com writes:
> I have a question about spinbuttons. It seems that the options
> Set_Numeric(.., False) and Set_Update_Policy(.., Update_If_Valid)
> are rather useless, because if you enter a nonnumeric text, it is
> suddenly changed to something numeric if the focus moves away from
> the spinbutton. This is not "update if valid" the way I see it.
> The reason I ask is that in my application, objects can be referred
> numbers and names. Mostly numbers will be used, so a spinbutton is
> useful, but I would still like to be able to enter a name, and read
> it as a Gtk_Entry. Will this be fixed in the future?
> Spinbuttons have no section in the Reference Manual, I hope later.
Set_Numeric is only usable to constraint what the user can insert in an
editable spin button. It is your reponsability to put a callback on the
"focus_out" signal to transform the text he typed into some numeric value (for
instance if you have a variable in your program, the user could reference its
value by typing its name).
It is not possible with gtk+-1.2.8 to have spin buttons with some non-numeric
value, although this has been added in the upcoming gtk+-2.0 release (no out
yet, and no Ada binding available).
You could have a look at the gtk+ documentation itself for more explanation on
spin buttons, and maybe you could contribute the documentation to be inserted
into GtkAda :-)
Emmanuel
More information about the gtkada
mailing list