obgtk: a fix



Here is a 'fix' for the "delete_event" hassle.
Its not elegant, but it works.

global var:
Gtk_App *theApp; // type needs to be the subclass if you do it that
way...

The function
gint dele(GtkWidget *w, gpointer data) { // actually I think the () can
be empty.
    return [theApp del];
}

Then, this method needs to be added to Gtk_App as a default for dele to
call.
-(BOOL)del
{
    [self free];
    return NO;
}

Then this method needs to be added also....
-connectDel:(Gtk_Object *)anObj
{
    theApp = self;
    [anObj signal_connect:"delete_event"
                            signalFunc:GTK_SIGNAL_FUNC(dele)
funcData:NULL];
    return self;
}

then you just call it like
[self connectDel:window];

and overide del.



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