[gimp/gtk3-port: 219/224] app: implement GtkContainer::get_path_for_child() in GimpMessageBox
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 219/224] app: implement GtkContainer::get_path_for_child() in GimpMessageBox
- Date: Wed, 1 Feb 2012 20:16:29 +0000 (UTC)
commit e3fc2d1dcaf7c15e9fd9cae264e1995d793c7be3
Author: Michael Natterer <mitch gimp org>
Date: Mon Sep 26 01:15:36 2011 +0200
app: implement GtkContainer::get_path_for_child() in GimpMessageBox
and handle our internal icon child ourselves.
app/widgets/gimpmessagebox.c | 43 +++++++++++++++++++++++++++++++++--------
1 files changed, 34 insertions(+), 9 deletions(-)
---
diff --git a/app/widgets/gimpmessagebox.c b/app/widgets/gimpmessagebox.c
index 1be5944..7d27a44 100644
--- a/app/widgets/gimpmessagebox.c
+++ b/app/widgets/gimpmessagebox.c
@@ -66,6 +66,9 @@ static void gimp_message_box_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
+static GtkWidgetPath *
+ gimp_message_box_get_path_for_child (GtkContainer *container,
+ GtkWidget *child);
G_DEFINE_TYPE (GimpMessageBox, gimp_message_box, GTK_TYPE_BOX)
@@ -80,17 +83,18 @@ gimp_message_box_class_init (GimpMessageBoxClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
- object_class->constructed = gimp_message_box_constructed;
- object_class->dispose = gimp_message_box_dispose;
- object_class->finalize = gimp_message_box_finalize;
- object_class->set_property = gimp_message_box_set_property;
- object_class->get_property = gimp_message_box_get_property;
+ object_class->constructed = gimp_message_box_constructed;
+ object_class->dispose = gimp_message_box_dispose;
+ object_class->finalize = gimp_message_box_finalize;
+ object_class->set_property = gimp_message_box_set_property;
+ object_class->get_property = gimp_message_box_get_property;
- widget_class->get_preferred_width = gimp_message_box_get_preferred_width;
- widget_class->get_preferred_height = gimp_message_box_get_preferred_height;
- widget_class->size_allocate = gimp_message_box_size_allocate;
+ widget_class->get_preferred_width = gimp_message_box_get_preferred_width;
+ widget_class->get_preferred_height = gimp_message_box_get_preferred_height;
+ widget_class->size_allocate = gimp_message_box_size_allocate;
- container_class->forall = gimp_message_box_forall;
+ container_class->forall = gimp_message_box_forall;
+ container_class->get_path_for_child = gimp_message_box_get_path_for_child;
gtk_container_class_handle_border_width (container_class);
@@ -342,6 +346,27 @@ gimp_message_box_forall (GtkContainer *container,
callback, callback_data);
}
+static GtkWidgetPath *
+gimp_message_box_get_path_for_child (GtkContainer *container,
+ GtkWidget *child)
+{
+ GimpMessageBox *box = GIMP_MESSAGE_BOX (container);
+
+ if (child == box->image)
+ {
+ GtkWidgetPath *path;
+
+ path = gtk_widget_path_copy (gtk_widget_get_path (GTK_WIDGET (container)));
+
+ gtk_widget_path_append_for_widget (path, child);
+
+ return path;
+ }
+
+ return GTK_CONTAINER_CLASS (parent_class)->get_path_for_child (container,
+ child);
+}
+
static void
gimp_message_box_set_label_text (GimpMessageBox *box,
gint n,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]