"losing" widget names
- From: John Breen <john linuxwa com au>
- To: gtk-list gnome org
- Subject: "losing" widget names
- Date: 20 Mar 2002 10:11:16 +0800
Ok, I got moving widgets from one container to another to work. The
gtk_widget_reparent() worked fine.
Now, I want to ONLY create the new window (and widgets) if they don't
already exist. I've tried this:
%<-------------------------------------------------------------------------------
void
on_inventory_add_items_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkWidget *mainwindow, *newparent, *inventorywindow, *vbox;
/* if the inventory stuff is not visible, make it so. */
mainwindow = lookup_widget(GTK_WIDGET(menuitem), "main_window");
if(!lookup_widget(mainwindow, "inventory_frame"))
{
newparent = lookup_widget(mainwindow, "vbox1");
inventorywindow = create_inventory_window();
vbox = lookup_widget(inventorywindow, "inventory_frame");
gtk_widget_reparent(vbox, newparent);
gtk_widget_show_all(vbox);
gtk_widget_destroy(inventorywindow);
}
}
%<-----------------------------------------------------------------------------
But clicking the menu option twice simply adds two copies of
inventory_frame to vbox1. It seems that inventory_frame isn't
recognised as being a part of mainwindow.
Any ideas?
TIA
John Breen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]