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

Re: Casting GTKWidgets - Urgent



> I am quoting this from gtk manual which deals with the callback
> function. It clearly states that the second argument is what the
> userinputs in the text_entry, which actually I want to catch...
>
> void enter_callback( GtkWidget *widget,
>                      GtkWidget *entry )
> {
>   gchar *entry_text;
>   entry_text = gtk_entry_get_text(GTK_ENTRY(entry));
>   printf("Entry contents: %s\n", entry_text);
> }


The changed signal on GtkEditable is like this
void enter_callback (GtkEditable *editable,
                                    gpointer user_data);

User_data is whatever you specified as the last argument to
gtk_signal_connect.

your function should be
void enter_callback (GtkEditable *editable,
                                gpointer user_data)
{
    gchar *entry_text;
    entry_text = gtk_entry_get_text (GTK_ENTRY (editable));
    printf("Entry contents: %s\n", entry_text);
}





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