obgtk bugs



I found out the hassle.
gtk+ doesn't even do it.
In KDE hitting the X results in a delete_event wich gets processed ok.
But if I goto fvwm and destroy the window, I get a seg fault - broken
pipe.
I did finally manage to get this same result out of obgtk, but there are
some problems.

When you send the event to a method, like so...
[window connectObj:"delete_event" :self];
the window dissapears no mater what the return value.  It also does not
exit the program correctly, wich it does in regular GTK+ if the return
is FALSE.

if you send it to a function like:
[window signal_connect:"delete_event" signalFunc:GTK_SIGNAL_FUNC(func)
funcData:NULL];
then you can get it to stay by returning TRUE, but returning FALSE still
does not result in a correct exit of the program.

When you send it to a method like so...
[window signal_connect:"delete_event" signalFunc:GTK_SIGNAL_FUNC([self
delete]) funcData:NULL]
you get a delete_event the instant the program starts, wich I find
really odd, also this exits imediately if the check turns out in favor
of closing...as most would on startup.

So, the best option seems to be to connect the window to a "destroy"
instead, like so
[window connectObj:"destroy" :self];
and that seems to do the trick if all you want to do is close the
window.

The only fix I found was to create a function that did this....
gint delete(GtkWidget *widget, gpointer data) {
    if([app isPressed]) { // isPressed returns YES if the HelloWorld
button was hit.
        g_print("Button was pressed...exiting.\n");
        [app free];
        return FALSE;
    }
    else {
        g_print("Button was not pressed, staying.\n");
        return TRUE;
    }
}

and connect with
[window signal_connect: "delete_event" etc.......];


If anyone out there knows a better way, let me know.  I would rather it
worked more smoothly, and I could do it in the object.

More on this subject for anyone who wishes.....there is other wierd
stuff.



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