[gtk+/client-side-decorations: 32/92] add container::remove interface
- From: Cody Russell <bratsche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/client-side-decorations: 32/92] add container::remove interface
- Date: Fri, 16 Apr 2010 19:29:48 +0000 (UTC)
commit 52276a14026c08d3605c2b31045a5ddbac6e4bc4
Author: Cody Russell <crussell canonical com>
Date: Wed May 27 12:45:47 2009 +0200
add container::remove interface
gtk/gtkwindow.c | 33 ++++++++++++++++++++++++++++++---
1 files changed, 30 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 5bae3ed..b9d319e 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -385,7 +385,8 @@ static void gtk_window_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
-
+static void gtk_window_remove (GtkContainer *container,
+ GtkWidget *child);
G_DEFINE_TYPE_WITH_CODE (GtkWindow, gtk_window, GTK_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
@@ -505,6 +506,7 @@ gtk_window_class_init (GtkWindowClass *klass)
container_class->check_resize = gtk_window_check_resize;
container_class->forall = gtk_window_forall;
+ container_class->remove = gtk_window_remove;
klass->set_focus = gtk_window_real_set_focus;
klass->activate_default = gtk_window_real_activate_default;
@@ -1520,7 +1522,7 @@ ensure_title_box (GtkWindow *window)
button = gtk_button_new ();
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
- image = gtk_image_new_from_stock (GTK_STOCK_ZOOM_IN, GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_stock (GTK_STOCK_ZOOM_OUT, GTK_ICON_SIZE_MENU);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
priv->min_button = button;
@@ -1529,7 +1531,7 @@ ensure_title_box (GtkWindow *window)
button = gtk_button_new ();
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
- image = gtk_image_new_from_stock (GTK_STOCK_ZOOM_OUT, GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_stock (GTK_STOCK_ZOOM_IN, GTK_ICON_SIZE_MENU);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
priv->max_button = button;
@@ -5939,6 +5941,31 @@ gtk_window_forall (GtkContainer *container,
(* callback) (priv->button_box, callback_data);
}
+static void
+gtk_window_remove (GtkContainer *container,
+ GtkWidget *child)
+{
+ GtkWindow *window = GTK_WINDOW (container);
+ GtkWindowPrivate *priv = GTK_WINDOW_GET_PRIVATE (window);
+
+ if (priv->title_label && priv->title_label == child)
+ {
+ gtk_widget_unparent (priv->title_label);
+ gtk_widget_destroy (priv->title_label);
+ priv->title_label = NULL;
+ }
+ else if (priv->button_box && priv->button_box == child)
+ {
+ gtk_widget_unparent (priv->button_box);
+ gtk_widget_destroy (priv->button_box);
+ priv->button_box = NULL;
+ }
+ else
+ {
+ GTK_CONTAINER_CLASS (gtk_window_parent_class)->remove (container, child);
+ }
+}
+
static gboolean
gtk_window_focus (GtkWidget *widget,
GtkDirectionType direction)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]