newbie question



Hi there.

I'm new to gtk (and pretty new to c too..)

I'm having trouble figuring out how to get data from various widgets...

for example,  I have a submit button, and in the submit_button_pressed 
callback I need to have access to other widget data, like the current value 
of a combo-box...

But, i don't have access do the combo-box's data in the submit-button's 
callback.

So, How can I pass several widget's data into a function?

Right now my callback looks like this:

void
on_submit_button_pressed               (GtkButton       *button,
                                        gpointer         user_data)
{

      char *string;
      string = 
gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(destination_combo)->entry));
      printf("SUBMIT PRESSED! Destination: %s\n\n", string);

}

but the gtk_entry_get part fails at compile time :
xdist_sig.c:56: `destination_combo' undeclared (first use in this function)

I'd be interested in the "right" way to deal with this data passing,
and also any short cuts anyone might know of.

thanks so much!

Graham Street




_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com



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