summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2004-07-05 21:31:24 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2004-07-05 21:31:24 +0000
commitbf5600ecd5ad0db87b1fddcbd4a5860903d9aa51 (patch)
treea830e44afd428274c2ad8bdb8e9b11fa81477bb1
parent0a3caf6b320e62c60de16ece2fb4d813b0e5fcd4 (diff)
downloadmdk-bf5600ecd5ad0db87b1fddcbd4a5860903d9aa51.tar.gz
mdk-bf5600ecd5ad0db87b1fddcbd4a5860903d9aa51.tar.bz2
preserve order of detachable windows when
reatached.
-rw-r--r--mixgtk/mixgtk_wm.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/mixgtk/mixgtk_wm.c b/mixgtk/mixgtk_wm.c
index 4ee3193..2b0691d 100644
--- a/mixgtk/mixgtk_wm.c
+++ b/mixgtk/mixgtk_wm.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mixgtk_wm.c :
* Implementation of the functions declared in mixgtk_wm.h
* ------------------------------------------------------------------
- * $Id: mixgtk_wm.c,v 1.10 2004/07/02 00:13:15 jao Exp $
+ * $Id: mixgtk_wm.c,v 1.11 2004/07/05 21:31:24 jao Exp $
* ------------------------------------------------------------------
* Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
*
@@ -156,7 +156,6 @@ mixgtk_wm_attach_window (mixgtk_window_id_t w)
mixgtk_config_update (infos_[w].config_key, DETACH_NO_);
if (gtk_notebook_get_n_pages (notebook_) == 1)
gtk_widget_show (GTK_WIDGET (notebook_));
- gtk_notebook_set_current_page (notebook_, -1);
}
}
@@ -266,14 +265,24 @@ add_page_ (GtkWidget *page, mixgtk_window_id_t id)
N_("_Virtual machine"), N_("_Source"), N_("_Devices")
};
+ gint p = 0;
+
g_assert (page != NULL);
g_assert (id < INF_NO_);
g_assert (notebook_ != NULL);
- gtk_notebook_append_page (notebook_, page,
- gtk_label_new_with_mnemonic (LABELS[id]));
- gtk_notebook_set_show_tabs (notebook_,
- gtk_notebook_get_n_pages (notebook_) > 1);
+ if (id > MIXGTK_MIXVM_WINDOW)
+ {
+ if (id == MIXGTK_DEVICES_WINDOW)
+ p = gtk_notebook_get_n_pages (notebook_);
+ else
+ p = infos_[MIXGTK_MIXVM_WINDOW].detached ? 0 : 1;
+ }
+
+ gtk_notebook_insert_page (notebook_, page,
+ gtk_label_new_with_mnemonic (LABELS[id]),
+ p);
+ gtk_notebook_set_current_page (notebook_, p);
gtk_widget_show (page);
gtk_widget_show (GTK_WIDGET (notebook_));
}
@@ -383,6 +392,7 @@ init_mixal_ (void)
gtk_widget_show (mixal);
gtk_widget_show (page);
+ gtk_widget_show (GTK_WIDGET (mixal_container_));
}
static void
@@ -531,11 +541,10 @@ mixal_detach_ (void)
MIXGTK_WIDGET_MIXAL_STATUSBAR));
g_assert (stat);
}
- else
- gtk_widget_reparent (infos_[MIXGTK_MIXAL_WINDOW].widget,
- GTK_WIDGET (mixal_container_));
mixgtk_mixal_reparent (stat);
+ gtk_widget_reparent (infos_[MIXGTK_MIXAL_WINDOW].widget,
+ GTK_WIDGET (mixal_container_));
}
static void