[gtk+] Don't use GTK_WIDGET_NO_WINDOW in GtkEventBox
- From: Christian Dywan <cdywan src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Don't use GTK_WIDGET_NO_WINDOW in GtkEventBox
- Date: Mon, 4 Jan 2010 07:41:29 +0000 (UTC)
commit d8adf58d387bce760b75459193cee6ed48c0e9ea
Author: Christian Dywan <christian twotoasts de>
Date: Mon Jan 4 08:41:07 2010 +0100
Don't use GTK_WIDGET_NO_WINDOW in GtkEventBox
gtk/gtkeventbox.c | 28 +++++++++++-----------------
1 files changed, 11 insertions(+), 17 deletions(-)
---
diff --git a/gtk/gtkeventbox.c b/gtk/gtkeventbox.c
index 70c2bb9..435c1f3 100644
--- a/gtk/gtkeventbox.c
+++ b/gtk/gtkeventbox.c
@@ -108,7 +108,7 @@ gtk_event_box_init (GtkEventBox *event_box)
{
GtkEventBoxPrivate *priv;
- GTK_WIDGET_UNSET_FLAGS (event_box, GTK_NO_WINDOW);
+ gtk_widget_set_has_window (GTK_WIDGET (event_box), TRUE);
priv = GTK_EVENT_BOX_GET_PRIVATE (event_box);
priv->above_child = FALSE;
@@ -184,7 +184,7 @@ gtk_event_box_get_visible_window (GtkEventBox *event_box)
{
g_return_val_if_fail (GTK_IS_EVENT_BOX (event_box), FALSE);
- return !GTK_WIDGET_NO_WINDOW (event_box);
+ return gtk_widget_get_has_window (GTK_WIDGET (event_box));
}
/**
@@ -242,7 +242,7 @@ gtk_event_box_set_visible_window (GtkEventBox *event_box,
visible_window = visible_window != FALSE;
- if (visible_window != !GTK_WIDGET_NO_WINDOW (widget))
+ if (visible_window != gtk_widget_get_has_window (widget))
{
if (GTK_WIDGET_REALIZED (widget))
{
@@ -253,11 +253,8 @@ gtk_event_box_set_visible_window (GtkEventBox *event_box,
gtk_widget_unrealize (widget);
- if (visible_window)
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_NO_WINDOW);
- else
- GTK_WIDGET_SET_FLAGS (widget, GTK_NO_WINDOW);
-
+ gtk_widget_set_has_window (widget, visible_window);
+
gtk_widget_realize (widget);
if (visible)
@@ -265,10 +262,7 @@ gtk_event_box_set_visible_window (GtkEventBox *event_box,
}
else
{
- if (visible_window)
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_NO_WINDOW);
- else
- GTK_WIDGET_SET_FLAGS (widget, GTK_NO_WINDOW);
+ gtk_widget_set_has_window (widget, visible_window);
}
if (GTK_WIDGET_VISIBLE (widget))
@@ -338,7 +332,7 @@ gtk_event_box_set_above_child (GtkEventBox *event_box,
if (GTK_WIDGET_REALIZED (widget))
{
- if (GTK_WIDGET_NO_WINDOW (widget))
+ if (!gtk_widget_get_has_window (widget))
{
if (above_child)
gdk_window_raise (priv->event_window);
@@ -397,7 +391,7 @@ gtk_event_box_realize (GtkWidget *widget)
priv = GTK_EVENT_BOX_GET_PRIVATE (widget);
- visible_window = !GTK_WIDGET_NO_WINDOW (widget);
+ visible_window = gtk_widget_get_has_window (widget);
if (visible_window)
{
attributes.visual = gtk_widget_get_visual (widget);
@@ -515,7 +509,7 @@ gtk_event_box_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
bin = GTK_BIN (widget);
- if (GTK_WIDGET_NO_WINDOW (widget))
+ if (!gtk_widget_get_has_window (widget))
{
child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width;
child_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width;
@@ -539,7 +533,7 @@ gtk_event_box_size_allocate (GtkWidget *widget,
child_allocation.width,
child_allocation.height);
- if (!GTK_WIDGET_NO_WINDOW (widget))
+ if (gtk_widget_get_has_window (widget))
gdk_window_move_resize (widget->window,
allocation->x + GTK_CONTAINER (widget)->border_width,
allocation->y + GTK_CONTAINER (widget)->border_width,
@@ -568,7 +562,7 @@ gtk_event_box_expose (GtkWidget *widget,
{
if (GTK_WIDGET_DRAWABLE (widget))
{
- if (!GTK_WIDGET_NO_WINDOW (widget))
+ if (gtk_widget_get_has_window (widget))
gtk_event_box_paint (widget, &event->area);
GTK_WIDGET_CLASS (gtk_event_box_parent_class)->expose_event (widget, event);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]