[gtk+/overlay: 21/34] overlay: unsert relative widget if it is not compatible with new main widget
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/overlay: 21/34] overlay: unsert relative widget if it is not compatible with new main widget
- Date: Sat, 11 Jun 2011 01:00:25 +0000 (UTC)
commit 89d79e2b60a2d46c1505684805688aaa8ee52dfa
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Fri May 27 10:47:28 2011 +0200
overlay: unsert relative widget if it is not compatible with new main widget
gtk/gtkoverlay.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index a98803c..13cc1d4 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -474,6 +474,19 @@ overlay_add (GtkContainer *container,
priv->main_widget = widget;
add_child (overlay, widget);
+
+ /* if we have a previously added relative widget we must check that it is
+ still valid */
+ if (priv->relative_widget != NULL &&
+ !gtk_widget_is_ancestor (priv->relative_widget, priv->main_widget))
+ {
+ g_warning ("The previously relative widget with type %s is not compatible "
+ "with the new main widget added %s, the relative widget will "
+ "be unset before continue",
+ g_type_name (G_OBJECT_TYPE (priv->relative_widget)),
+ g_type_name (G_OBJECT_TYPE (widget)));
+ gtk_overlay_set_relative_widget (overlay, NULL);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]