Re: Spin Buttons



>I see. But is there a way to assign the value of a spin button directly to a v
>ariable instead of going through a function and thus being forced to have glob
>al variables? In example, if I want to assign the value of a spin button to a 
>float variable a (declared locally), what do I do? Is it possible to use sth l
>ike
>
>a = gtk_spin_button_i_dont_know_what (Spin);    ? ;)

The GtkAdjustment associated with a spin button always holds the value
of the button, since the value of the adjustment *is* the value of the
button. So, you should create the GtkAdjustment first, and then create
the spinbutton. 

    GtkWidget *adj = gtk_adjustment_new (...);
    GtkWidget *spin = gtk_spin_button_new (adj, ...);

whenever you want the value, just use the adjustment.

--p




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