XForms: browser object

Peter Hanley (peter@hanley.demon.co.uk)
Tue, 21 Sep 1999 12:05:29 +0100 (BST)

# To subscribers of the xforms list from Peter Hanley <peter@hanley.demon.co.uk> :

I am using FL_HOLD_BROWSER as a file viewer, to select a range of lines,
and to return line numbers to an application.

This is using forms.88 on pc-linux 2.2

To highlight the selected range I am using code like:

fl_freeze_form(viewer_form);
for(i = first; i <= last; i++)
{
/* make selected lines highlighted */
strncpy(buffer1, fl_get_browser_line(file_viewer,i), BUFFER_SIZE);
if(*buffer != '@')
{
sprintf(buffer2,"@C%i",SELECTION_COLOR);
strncat(buffer2, buffer1, BUFFER_SIZE);
fl_replace_browser_line(file_viewer,i,buffer2);
}
}
fl_unfreeze_form(viewer_form);

This produces the desired behaviour, but if fl_replace_browser_line is
called more than a certain number of times (typically 90 or 100) I get a
segmentation fault. I can get more lines if SELECTION_COLOR has one digit
rather than two, so it is as if there is insufficient memory allocated
for the extra line length. Is there anything that I can do about this?

Thankyou

Peter Hanley

==============================================================================
Western Lodge, Parkend +44 01594 562817
Lydney peter@hanley.demon.co.uk
Gloucestershire GL15 4JQ
UK
==============================================================================

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