Re: XForms: What's up with this?

Gerald Gryschuk (ggryschuk@scf.sk.ca)
Tue, 14 Jul 1998 15:22:10 -0600

# To subscribers of the xforms list from Gerald Gryschuk <ggryschuk@scf.sk.ca> :

Steve Lamont wrote:
>
> # To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :
>
> > I was attempting to create my own object when I discovered the following
> > behaviour, which may not be unexpected but I was wondering how to get
> > around it. If you add text directly to a form using fl_drw_text then
> > resize the form using the mouse or freeze the form and then resize an
> > object on the form and unfreeze the form the text disappears. ...
>
> The fl_drw*() functions are intended to be used from within object
> handlers and not from within callbacks. Their drawing result is
> ephermeral -- when an event, such as a resize, which requires the form
> to be redrawn occurs, the form (meaning the Window) is cleared and all
> objects are redrawn. Unless you explicitly handle the event with a
> raw callback (see the Dirty Tricks section of the manual), whatever
> has been drawn with any of the fl_drw*() functions will naturally
> disappear.
>

In other words what I saw was expected behaviour. That just leaves one
question in my mind. If it's not giving away too much about the form
library code, how does the browser get away with resizing itself and not
causing the form to be redrawn? In other words taking out the
fl_set_object_size line in my example code doesn't cause the yellow
triangle to disappear, so the browser must be doing something other than
a fl_set_object_size when it needs to resize itself.

The reason why I'm asking is that I was going to take your advice about
using the browser instead of the fselector object(see my message "Using
fselector for other than files"). But I realized it couldn't do
something I wanted it to, or at least I don't think it can, please
correct me if I'm wrong. 1) I wanted to be able to use symbols in the
browser, I tried doing a fl_add_browser_line with the text set to "@>"
but the triangle didn't get output. 2) I wanted to use text of different
colors in the browser, more specifically I wanted a symbol at the
beginning of the line in one color and the text in a different color.
Anyway, the upshot is that I ended up reimplementing the browser using a
box and 2 scrollbars. I (will) call my browser "fancybrowser" because it
can display any piece of text in any color you want, plus it can embed
symbols in the text. I'm thinking of making it be able to handle
different font sizes and styles for any piece of text but that isn't
really what I needed. I had/have mine doing exactly what a browser does
EXCEPT for this difference with resizing. When I insert text into my
browser and it goes outside the bounds of the box I reduce its size by a
predetermined amount and reset it's size with fl_set_object_size, thus
exposing the scrollbar(s). But in my case the piece of text displayed on
the form disappears because of this, which as you say is expected, but
it's still a puzzle.

By the way, if you tell me the browser can do all this already I'll
shoot myself. Wellll... no I wont' it was kinda fun doing this and I
sure learnt alot about xforms so far.

Thanks again.

-- 
Gerald Gryschuk(ggryschuk@scf.sk.ca)
Programmer Analyst
Saskatoon Cancer Centre
((306)655-2746)
_________________________________________________
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/