multiple arguments to callback function
- From: Aaron Walker <amwalker gate net>
- To: gtk-list redhat com
- Subject: multiple arguments to callback function
- Date: Wed, 24 Nov 1999 16:50:39 -0500
I am writing a bit of code that has three text entries and a button.
When I click on the button, I would like it to gather all the text in
those entries so that I can use it.
I tried writing a callback function like this:
void button_clicked(GtkWidget *widget,
GtkEntry *entry1,
GtkEntry *entry2,
GtkEntry *entry3)
{
gchar *dir, *search, *content;
dir = gtk_entry_get_text(GTK_ENTRY(entry1));
search = gtk_entry_get_text(GTK_ENTRY(entry2));
content = gtk_entry_get_text(GTK_ENTRY(entry3));
g_print("Contents of dir: %s\n", dir);
g_print("Contents of search: %s\n", search);
g_print("Contents of content: %s\n", content);
}
then calling it like this:
gtk_signal_connet(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(button_clicked),
entry1, entry2, entry3);
but, obviously, this did not work. Is there a way to pass multiple
arguments to a callback or would I go about doing this a different way?
Thanks,
Aaron
--
This message is powered by RedHat 6.1 and Perl
Visit my web site at http://iconmedia.com/cgi-bin/index.pl
Current uptime:
4:42pm up 21:28, 1 user, load average: 0.25, 0.29, 0.23
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]