[gtkglarea] gtkgl/gtkglarea.c: Use accesor functions to access widget flags



commit 42e649d5d91fdc21fd154e305b2a710ff7fb032e
Author: Javier Jardón <javier jardon codethink co uk>
Date:   Thu Mar 20 13:27:43 2014 +0000

    gtkgl/gtkglarea.c: Use accesor functions to access widget flags

 gtkgl/gtkglarea.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtkgl/gtkglarea.c b/gtkgl/gtkglarea.c
index 74ad43d..ea8e6ab 100644
--- a/gtkgl/gtkglarea.c
+++ b/gtkgl/gtkglarea.c
@@ -144,16 +144,19 @@ gint gtk_gl_area_make_current(GtkGLArea *gl_area)
 {
   g_return_val_if_fail(gl_area != NULL, FALSE);
   g_return_val_if_fail(GTK_IS_GL_AREA (gl_area), FALSE);
-  g_return_val_if_fail(GTK_WIDGET_REALIZED(gl_area), FALSE);
+  GtkWidget *widget = GTK_WIDGET (gl_area);
+  g_return_val_if_fail(gtk_widget_get_realized(widget), FALSE);
 
-  return gdk_gl_make_current(gtk_widget_get_window (GTK_WIDGET(gl_area)), gl_area->glcontext);
+  return gdk_gl_make_current(gtk_widget_get_window (widget),
+                             gl_area->glcontext);
 }
 
 void gtk_gl_area_swap_buffers(GtkGLArea *gl_area)
 {
   g_return_if_fail(gl_area != NULL);
   g_return_if_fail(GTK_IS_GL_AREA(gl_area));
-  g_return_if_fail(GTK_WIDGET_REALIZED(gl_area));
+  GtkWidget *widget = GTK_WIDGET (gl_area);
+  g_return_if_fail(gtk_widget_get_realized(widget));
 
-  gdk_gl_swap_buffers(gtk_widget_get_window (GTK_WIDGET(gl_area)));
+  gdk_gl_swap_buffers(gtk_widget_get_window (widget));
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]