GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Oct 30, 2014 5:31 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: lookup_widget() menuitem
PostPosted: Thu Apr 12, 2007 8:04 pm 
Offline
Familiar Face

Joined: Sat Mar 10, 2007 5:45 pm
Posts: 5
I'm using lookup_widget() in a callback for a menuitem.
Code:
   void
on_preferences_activate                (GtkWidget     *menuitem,
                                        gpointer         user_data)
{
  txt_server = lookup_widget(GTK_WIDGET(menuitem), "txt_server");
  GtkWidget* combo = lookup_widget(GTK_WIDGET(menuitem), "cmb_prefix");
  gtk_entry_set_text(txt_server, server);
  gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (combo)->entry), server_type);
    
  gtk_widget_show (prefsDialog);
}

I've seen lookup_widget used in other programs and they work fine, but when I run my program lookup_widget() prints
Code:
** (patcher:6391): WARNING **: Widget not found: txt_server

** (patcher:6391): WARNING **: Widget not found: cmb_prefix

I've checked the names of the widgets, they are valid in callbacks for buttons, but it doesn't work with menuitems.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 14, 2007 12:49 am 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
I'm not sure how lookup_widget() works, as I don't use glade to generate the code but use libglade or pure GTK+ myself.

Are you saying that exact same callback works fine with GtkButton's but not with the menu items?

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 14, 2007 8:17 pm 
Offline
Familiar Face

Joined: Tue Jan 23, 2007 6:13 pm
Posts: 34
lookup_widget() works fine with any widget. I am suse in that.
This is not possible to work with some widgets and do not work with others.....
I think you just wrong the parent widget.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 3:25 pm 
Offline
Familiar Face

Joined: Sat Mar 10, 2007 5:45 pm
Posts: 5
Micah Carrick wrote:
I'm not sure how lookup_widget() works, as I don't use glade to generate the code but use libglade or pure GTK+ myself.

Are you saying that exact same callback works fine with GtkButton's but not with the menu items?

Yes.
hydra wrote:
I think you just wrong the parent widget.

How so?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 21, 2007 2:13 pm 
Offline
Familiar Face

Joined: Tue Jan 23, 2007 6:13 pm
Posts: 34
If you use wrong parent widget and think there is child widget called "xyz" you will get this error message...
Just post here your code ... especially the code where you call the lookup_widget.
Give me the content of the parent widget too.
I will show you right widget searching..


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group