Re: XForms: Loading an input

T.C. Zhao (zhao@bloch.phys.uwm.edu)
Wed, 29 Oct 1997 22:41:03 -0600

To subscribers of the xforms list from "T.C. Zhao" <zhao@bloch.phys.uwm.edu> :

On Oct 27, 6:00am, Steve Lamont wrote:
> Subject: Re: XForms: Loading an input
> To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :
>
> > Is there a way I can load a file to a multiline input?
> > Something similar to fl_load_browser()? Or will I have to read the
>
> Probably the easiest way to do what I think you want to do is to
> memory map the file using the mmap() function, feed the pointer handed
> to you by mmap() to fl_set_input(), then unmap and close the file.
I think this is the best way to load a file into an input field. Of course
using ftell and fread should do the trick nicely as well.

> There probably ought to be a more explicit way to do this. There
> probably ought to also be a way to arbitrarily add text to an Input
> field
Agreed. Unfortunately the internal data structure of the input
field does not lend itself well in doing this kind of thing.
I am kind of amazed that performace of the input field is not
too bad given the terrible internal structure. I will be
changing the input internal structure after V0.88. For now,
robustness and stability are the major concern.

-- 
----
T.C. Zhao - (used to be a) starving physicist
_________________________________________________
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/