[Glade-users] need help with lookup_widget()



One way to solve the problem is to make all main windows as global 
variables that you call from within your callback.c file using:

extern GtkWidget main_window;

and declaring the same variable in main.c outside the main function.

If you don't have many main_window type of variables, this should get 
around this problem.

        Fabio.


On Fri, 9 Jul 2004, Stanislav Yudin wrote:

Date: Fri, 09 Jul 2004 23:45:34 +0400
From: Stanislav Yudin <decvar inbox ru>
To: Glade Users List <glade-users lists ximian com>
Subject: [Glade-users] need help with lookup_widget()

Hi all.

I have a problem with lookup_widget(). 
In Anjuta's project, generated with Glade, in main.c I've called 
--------------------------------------------------------------
GtkWidget *my_window;
GtkWidget *one_more_window;

my_window=create_my_window();
one_more_window = create_one_more_window();

gtk_widget_show(one_more_window);
------------------------------------------------------------
But didn't call gtk_widget_show(my_window);

Now, I want to display my_window and close one_more_window in
callbacks.c.
There is a button in one_more_window, and in callback for clicked event
for that button I wrote:
-----------------------------------------------------------------------
void
on_my_btn_clicked (GtkButton *button,gpointer data)
{
GtkWidget *one_more_window;
GtkWidget *my_window;

one_more_window = lookup_widget(button,"one_more_window");
gtk_widget_destroy(one_more_window);

my_window=lookup_widget(button,"my_window");
-------------------------------------------------------------
But there is a error that widget my_window is not found. 
create_my_window() and create_one_more_window() is in interface.c.
If I call for gtk_widget_show(my_window) in main.c - it's displayed ok.
So it just can't find my_window. Therefore, I can't call
gtk_widget_show() Any ideas?

Regards, decvar

_______________________________________________
Glade-users maillist  -  Glade-users lists ximian com
http://lists.ximian.com/mailman/listinfo/glade-users





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