lookup_widget trouble



Hello,
I'm new to GTK. At the moment I'm just trying to have a GTKButton that,
when clicked, sets a message text to a GTKEntry.

Here's my code in callbacks.c
<snip>
void
on_button1_clicked                    (GtkButton       *button,
                                        gpointer         user_data)
{
        GtkWidget *entry1;
        entry1 = lookup_widget(GTK_WIDGET(entry1), "entry1");
        gtk_entry_set_text(GTK_ENTRY(entry1), "abc");
}
</snip>

It compiles fine, but when I run it, the program crashes.
I'm sure there's something wrong with the lookup_widget method but I
can't understand what.

Can anybody help me please?

Thank you
Fred





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