Re: XForms: I which to registrer a complaint...

Mats Bergstrom (mb@talws10.nbi.dk)
Mon, 6 Oct 1997 16:03:55 GMT

To subscribers of the xforms list from mb@talws10.nbi.dk (Mats Bergstrom) :

> One answer is to either use XUnmapWindow() to sidestep XForms
> entirely. This simply hides the Window/form without destroying the
> Canvas object. ...
Yes, this is the solution that I had in mind to check -- I just wanted
to hear if anyone else had experience in this particular problem.
However, though hiding the window would make sure that it would not
get most events some might still come around and confuse the internals
in the library (causing more trouble of that kind).

> The other solution is to resort to a hack such as the one below:
>
> void destroy_form( FL_FORM *form )
>
> {
>
> void *dui = form->fdui;
> FL_OBJECT *obj = form->first;
>
> /*
> * This hack necessary because it appears that the cleanup
> * routine is otherwise called after the window is destroyed!
> */
>
> do
> if ( ( obj->objclass == FL_CANVAS ) ||
> ( obj->objclass == FL_GLCANVAS ) )
> fl_hide_object( obj );
> while ( obj = obj->next );
>
> fl_hide_form( form );
> fl_free_form( form );
> free( dui );
>
> }
>
> The function traverses the object list and looks for objects of class
> FL_CANVAS or FL_GLCANVAS and nukes them first before hiding the form
> and, in this case, destroying it. If you wanted to just hide the
> form, you could elide the fl_free_form() and free() functions.

Yes, this would work in most cases. However, if the menu (as describe
in my scenario) is removed BEFORE the menu callback is executed, the
`Expose' event will still be in the event stack and acted upon. Come
to thing of it there can also be some `EnterNotify', `FocusIn' and
`MotionNotify' event sent if we are really unlucky...

> > ... I'm extremely reluctent to move my application into
> > Motif as I am very happy with the forms library.
>
> Don't do it!
>
> I'd rather gnaw my own legs off and then run a marthon on broken glass
> and rock salt rather than go back to Bloatif...

I agree, I'd rather fill up the memory with something useful than
resources describing that the third character of the second item in a
menu should be green...

/Mats
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/