[glade3] Minor code cleanup in glade-widget.c (use gtk_widget_get_ancestor instead of looping).
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3] Minor code cleanup in glade-widget.c (use gtk_widget_get_ancestor instead of looping).
- Date: Thu, 6 Jan 2011 08:19:34 +0000 (UTC)
commit 53c3782c8b7967daf7d29385548e58fd96b2dc39
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Thu Jan 6 16:54:35 2011 +0900
Minor code cleanup in glade-widget.c (use gtk_widget_get_ancestor instead
of looping).
gladeui/glade-widget.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index b780e99..4fd181d 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -3366,10 +3366,11 @@ glade_widget_child_get_property (GladeWidget * widget,
}
static gboolean
-glade_widget_event_private (GtkWidget * widget,
- GdkEvent * event, GladeWidget * gwidget)
+glade_widget_event_private (GtkWidget *widget,
+ GdkEvent *event,
+ GladeWidget *gwidget)
{
- GtkWidget *layout = widget;
+ GtkWidget *layout;
/* Dont run heavy machienery for events we're not interested in
* marshalling */
@@ -3377,8 +3378,7 @@ glade_widget_event_private (GtkWidget * widget,
return FALSE;
/* Find the parenting layout container */
- while (layout && !GLADE_IS_DESIGN_LAYOUT (layout))
- layout = gtk_widget_get_parent (layout);
+ layout = gtk_widget_get_ancestor (widget, GLADE_TYPE_DESIGN_LAYOUT);
/* Event outside the logical heirarchy, could be a menuitem
* or other such popup window, we'll presume to send it directly
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]