Re: GtkGLArea demo programs



I set a break point on this function.  It stops at the line:

     int w = widget->allocation.width;

when I type continue it immediately SEGSEGV at the address listed below.  I
suspect the the line:

    if (gtk_gl_area_make_current (GTK_GL_AREA(widget)))
    {

is the problem, but it is required by Gtkglarea, and it is the exactly the same
line as in the example program that works.  So  I am pretty baffled right now.

Any suggestions would be appreciated.  (even a response saying "bummer dude",
would at least let me know you are alive  :-)

I was a bit hesitant to post this at first but seeing another newbie at
glarea having problems I felt it's more important to post this.

I recently encounted the exact same problem with glarea as you did,
to resolve the problem I changed the way the signals were set up.

See following code to create yer glarea widget:

        w = gtk_gl_area_new(gl_attributes_list);
        gtk_widget_set_events(w,
            GDK_EXPOSURE_MASK | GDK_KEY_PRESS_MASK |
            GDK_KEY_RELEASE_MASK | GDK_BUTTON_PRESS_MASK |
            GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK |
            GDK_POINTER_MOTION_HINT_MASK
        );
        gtk_signal_connect(
            GTK_OBJECT(w), "key_press_event",
            GTK_SIGNAL_FUNC(View2DViewEventCB),
            v
        );
        gtk_signal_connect(
            GTK_OBJECT(w), "key_release_event",
            GTK_SIGNAL_FUNC(View2DViewEventCB),
            v
        );
        gtk_signal_connect(
            GTK_OBJECT(w), "button_press_event",
            GTK_SIGNAL_FUNC(View2DViewEventCB),
            v
        );
        gtk_signal_connect(
            GTK_OBJECT(w), "button_release_event",
            GTK_SIGNAL_FUNC(View2DViewEventCB), 
            v
        );
        gtk_signal_connect(
            GTK_OBJECT(w), "motion_notify_event",
            GTK_SIGNAL_FUNC(View2DViewEventCB),
            v
        );
        gtk_signal_connect(
            GTK_OBJECT(w), "expose_event",
            GTK_SIGNAL_FUNC(View2DViewEventCB),
            v
        );
        gtk_signal_connect(
            GTK_OBJECT(w), "configure_event",
            GTK_SIGNAL_FUNC(View2DViewEventCB),
            v
        );
/*
        gtk_signal_connect(
            GTK_OBJECT(w), "realize",
            GTK_SIGNAL_FUNC(View2DViewEventCB),
            v
        );
 */
/*
        gtk_signal_connect(
            GTK_OBJECT(w), "destroy",
            GTK_SIGNAL_FUNC(View2DViewEventCB),
            v
        );
 */
        gtk_box_pack_start(GTK_BOX(parent), w, TRUE, TRUE, 0);
        gtk_widget_show(w);


It turns out that commenting our the realize and destroy signals seemed to
have fixed the problem for myself.

However I am not certain as to what exactly is the problem.
It's possable that the signals were connected in the wrong order or
something wrong in the signal handler... I'm not sure but try the above
to see if it works.


--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
..__                         ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                  http://furry.ao.net/~learfox/





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