Re: XForms: drawing a line in fl_add_free from a data file

Stephen Langer (
Thu, 21 Aug 1997 09:17:10 -0400

To subscribers of the xforms list from "Stephen Langer" <> :

> To subscribers of the xforms list from Raoul Beauduin
<> :
> > > Looks as if XForms has lost track of the object's Window for one
> > > reason or another. You might try calling
> > >
> > > fl_winset( FL_ObjWin( free_object ) );
> > >
> > > to make sure you're pointing to the right place.
> >
> > Thank you. It worked. But an other problem occured.
> > I am using Fvwm2 as window manager. Every time i change of screen and
> > come back, the lines i have drawn in fl_add_free have all disappeared.
> > How can I make them stick to the free object?
> Oups! correction! When I change of desktop, the lines are deleted.
> Inside a desktop, moving from one screen to another and then back to
> where the application is, does not delete the lines.
> Any explanation?

What happens when you cover up the window with another window, then
expose it? The lines probably don't show up.
It sounds as if you're not handling the FL_DRAW events properly in
the free object handler. I'd guess you're trying to do something
like this:

FILE *file = fl_show_fselector(...);
while(readline_from_file(file, line))

whereas what you should do is something like this:

FILE *file = get_file_from_fselector();
while(readline_from_file(file, &line))

and in the free object handler:

switch(event) {
case FL_DRAW:

Then you don't need to call fl_winset(), since XForms knows that you're
drawing in the free object when it calls the free object handler. Also,
you've saved the information about how to redraw the window after it's
been hidden by another window.

-- Steve

-- EMail:                    Phone: (301) 975-5423 --
-- WWW:    Fax:   (301) 990-4127 --
-- Mail: Building 820 Room 365; NIST; Gaithersburg, Md          20899-0001 --
To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: