Deleting in TEXTSW_BROWSING=TRUE textsw's

Mark J. Kilgard mjk at puffed.rice.edu
Sat Jan 6 20:37:19 AEST 1990


SunView programmers (or have they all switched to X),

The following seems to be a bug in SunView - or an extreme misfeature at
best.  It seems tha if you have a textsw in TEXTSW_BROWSING mode TRUE, you
can not use textsw_delete() [and probably textsw_erase() too].  The
operation doesn't do anything and returns its appropriate failure status
when a window is in browsing mode.  Even though textsw_insert() works fine
in browsing mode.

You can get around the problem by doing a:

window_set(textsw, TEXTSW_BROWSING, FALSE, 0);
textsw_delete(textsw, first, last_plus_one);
window_set(textsw, TEXTSW_BROWSING, TRUE, 0);

I assume because of they use the same primitive routines,
textsw_replace_bytes() and using TEXTSW_CONTENTS also fail to do their
delete function too, BUT do do the correct insert part of their operation.
Ie, these routines do the equivalent of an insert.

The above solution applies for these functions too.

I could understand if NO editing was allowed through the programmer
interface to textsw when in browsing mode, but why do inserts work and
deletes fail?  This seems inconsistent to me.

- Mark Kilgard



More information about the Comp.sys.sun mailing list