On Tue, 14 Nov 2000, wackode .....! wrote:
> Hello guys:
>
> I have a C/Glade program with 1 spinbutton and 1 button, on callbacks.c I
> have this:
> -----------------------------------------------
> void
> on_apply_clicked
> {
> GtkWidget *spinbutton;
>
> }
> -----------------------------------------------
> -how do i get spinbutton's value?
>
> -should I use this?
> -----------------------------------------------
>
> spinbutton = lookup_widget(GTK_WIDGET (?????), "my_spinbutton");
> gtk_spin_button_get_value_as_int (spinbutton);
Yes, it's quite so. You can retrieve data about your spinbutton also in
this way
spinbutton = gtk_object_get_data(GTK_OBJECT(widget),"spinbutton");
widget is often the main window in which spinbutton is, you may declare
it as a global variable. Notice that, when widgets are created, they are
associated to their main window by the function
gtk_object_set_data_full(GTK_OBJECT(window),"widget",widget,
(GtkDestroyNotify) gtk_widget_unref),
"widget" is a const gchar key to retrieve data about widget from window or
other objects tou created.
Then you can use gtk_spin_button_get_value_as_int(...)
I hope to be useful to you.
Rosa :)
> -----------------------------------------------
>
> Regards
> Wackode....!
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
>
> _______________________________________________
> Glade-devel maillist - [EMAIL PROTECTED]
> http://lists.helixcode.com/mailman/listinfo/glade-devel
>
_______________________________________________
Glade-devel maillist - [EMAIL PROTECTED]
http://lists.helixcode.com/mailman/listinfo/glade-devel