[Glade-users] Accessing multiple objects from one callback.



Hi,

I am new to glade/gtk, but slowly getting there.

I have an application where I have a callback on a button which passes
the pointer to another widget to it. i.e. I click a button, and the object
of an entry box on the same window gets past to the callback routine.

This works fine - I add the entrybox name to the glade "Data" form on the
Signal handler form for say a "clicked" signal.

My interface gets written as:

################################################
  gtk_signal_connect (GTK_OBJECT (button1), "clicked",
                      GTK_SIGNAL_FUNC (on_button1_clicked),
                      TextEntry);
################################################
And my callback look like:
################################################
void
on_ok_button1_clicked                  (GtkButton       *button,
                                        gpointer         user_data)
{
 gchar *entry_text;
 entry_text = gtk_entry_get_text(GTK_ENTRY(user_data));
 printf("File is: %s\n", entry_text);

}
################################################


Now the question is, if I want my button to look at MORE than one
widget in the window, to extract current values how do I specify
this in glade and/or gtk++ directly. It would appear only one 
widget can be passed to a callback at a time ??

Do I need to pass the widget pointer of the WHOLE window, and extract
out the ones I am interested in ?? If so is there any example code
that I can look at to achieve this..

I look forward to your thoughts....

Best regards

Colin Thomas

ps. I have on order the "GTK+/Gnome Application Development" bbok
by Havoc Pennington - what is the current judgement on it ? Are
there any more planned ?? 


################################################

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Colin Thomas. 
| Email   : colin designresources co uk     
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






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