[Glade-users] reparenting a GtkDrawingArea with OpenGl



I'm still interested in your thoughts, glade users, but I thought this
mailing list is more appropriate:
http://mail.gnome.org/archives/gtkglext-list/2009-May/msg00028.html

On Fri, May 15, 2009 at 2:01 PM, Jeff Eberl <jeffeb3 at gmail.com> wrote:

I have  a window with two GtkDrawingArea's.  One is a map and one is a
picture, I'm trying to swap the two windows with the click of a button.
Surrounding each drawing is a bunch of buttons and things.

This is how I reparent them:

gtk_widget_ref(map_widget);
gtk_widget_ref(pic_widget);

gtk_container_remove(left_container, map_widget);
gtk_container_remove(right_container, pic_widget);

gtk_container_add(left_container, pic_widget);
gtk_container_add(right_container, map_widget);

gtk_widget_unref(map_widget);
gtk_widget_unref(pic_widget);

The buttons, the boxes, and everything in the widgets swaps out, but the
next time I try to draw in either of them, the gdk_gl_drawable_gl_begin
fails:

GdkGKExt-CRITICAL **: gdk_gl_window_impl_x11_make_context_current:
assertion 'GDK_IS_GL_CONTEXT_IMPL_X11 (glcontext)' failed

So, that's a bummer.  I didn't write the code I'm using to instantiate the
widgets, or draw the pic/map.  I'm wondering if maybe the problem is that
the "realize" event gets called twice, but all the gdk setup stuff is
actually in a different method, one that doesn't get called twice.  The
realize callback doesn't really have anything in it.

Any help would be appreciated.  I'm running in circles.

Jeff


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20090515/d4084fe7/attachment.html 




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