[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
re: newbie question:about
- From: carlos pehoe civil ist utl pt (Carlos Pereira)
- To: gtk-app-devel-list gnome org
- Subject: re: newbie question:about
- Date: Fri, 19 Sep 2003 15:45:21 +0100 (WEST)
> Hello, can anyone please help me? I am trying to get
>an user input via the text entry box by clicking on a
>button
>in the application. So once they enter into the text
>entry and press the button, I will then collect the
>data with some callback function. I really don't know
>how to connect the button to the entry so it would
>catch the text entry's "clicked" signal and then call
>the callback function.
1) Connect your button to some callback like this static_ok,
then in the callback retrieve the entry contents:
2) you can connect your entry to the "changed" signal,
which is activated always the entry contents changes.
3) You should study the excelent examples that come with GTK.
Carlos
-------------------------------------------
static void static_ok (GtkWidget *widget, gpointer data)
{
gamgi_window *window = GAMGI_CAST_WINDOW data;
GtkWidget *dialog = window->dialog0;
GtkWidget *entry;
char *name;
entry = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (dialog), "my_entry");
name = gtk_entry_get_text (GTK_ENTRY (entry));
printf ("%s\n", name);
}
----------------------------------
gtk_signal_connect (GTK_OBJECT (entry), "changed",
GTK_SIGNAL_FUNC (static_changed), window);
------------------------------------
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]