GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

lookup_widget() menuitem

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
windslip
Familiar Face


Joined: 10 Mar 2007
Posts: 5

PostPosted: Thu Apr 12, 2007 8:04 pm    Post subject: lookup_widget() menuitem Reply with quote

I'm using lookup_widget() in a callback for a menuitem.
Code: (Plaintext)
1
2
3
4
5
6
7
8
9
10
11
12

    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: (Plaintext)
1
2
3
4
** (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.
Back to top
Micah Carrick
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 427
Location: Portland, OR USA

PostPosted: Sat Apr 14, 2007 12:49 am    Post subject: Reply with quote

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?
Back to top
hydra
Familiar Face


Joined: 23 Jan 2007
Posts: 35

PostPosted: Sat Apr 14, 2007 8:17 pm    Post subject: Reply with quote

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.
Back to top
windslip
Familiar Face


Joined: 10 Mar 2007
Posts: 5

PostPosted: Tue Apr 17, 2007 3:25 pm    Post subject: Reply with quote

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?
Back to top
hydra
Familiar Face


Joined: 23 Jan 2007
Posts: 35

PostPosted: Sat Apr 21, 2007 2:13 pm    Post subject: Reply with quote

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..
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP