Re: re:gtk entry



On Tue, 2005-07-26 at 15:35 +0530, srinivas wrote:
hi;

     i am having pbm with gtk_entry widget,

i created entry with glade, and i accessed entry using lookup_widget,
when i tried to get text entered in to entry widget, i am not getting
the text.

here is the  procedure i did,

      GtkWidget *window_entry1, *window_entry, *entry_sel;
const gchar *txt;
 window_entry1 = create_window_tree_entry_append();
window_entry  = lookup_widget (window_entry1,
"window_tree_entry_append");
entry_sel  = lookup_widget (window_entry,  "entry_tree_append");

Why you initiallized "window_entry1" and now you call lookup_widget with "window_entry" as parameter ? (Note 
the leading "1").
When did you initiallized "window_entry" ?
Does changing "window_entry" here for "window_entry1" change things '


txt = gtk_entry_get_text (GTK_ENTRY (entry_sel));

Try this:

if( entry_sel )
        txt = gtk_entry_get_text (GTK_ENTRY (entry_sel));
else{
        dialog = gtk_message_dialog_new (NULL,
                                  GTK_DIALOG_DESTROY_WITH_PARENT,
                                  GTK_MESSAGE_ERROR,
                                  GTK_BUTTONS_CLOSE,
                                  "Lookup widget failed" );
        gtk_dialog_run (GTK_DIALOG (dialog));
        gtk_widget_destroy (dialog);
        return; //??
}
                
the characters entered in entry are not getting, i tried to print txt
but no string itz printing;

If you check the you application's stdout - launching it from an xterm -
it's almost sure you'll read some error messages about lookup_widget
failing.


what z wrong i am doing here;

It seems your Glade file may be messed a bit, so you're using two
variables to hold the GtkWindow pointer, but you initiallize one and
then use the other (uninitiallized) one.

-- 
Iago Rubio <iago iagorubio com>




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