Spin button suggestion



Hi:

I just added spin buttons to my application and would 
like share some comments with the list:


The spin button api has two functions to set the value:

gfloat  gtk_spin_button_get_value_as_float (GtkSpinButton  *spin_button);

gint    gtk_spin_button_get_value_as_int   (GtkSpinButton  *spin_button);

but only to get it:

void    gtk_spin_button_set_value          (GtkSpinButton  *spin_button, 
                            gfloat          value);

This asymmetry seems strange to me.

Also, and this should probably go into the tutorial, a call to 
gtk_spin_button_set_update_policy   might trigger an value_changed event
in the underlying adjustment.
This might lead to unexpected behaviour during initialization.
My fix is to not signal_connect anything to the the adjustment until
I am done with the spin button.
This probably applies to other "range" widgets as well.

Robert



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]