Sunview question
John Oswalt
jao at megatest.uucp
Wed Jan 25 17:13:19 AEST 1989
I have a subwindow in which I display text output from a program, and in
which I echo characters typed by the user. I do various cooking on these
characters before sending them to the program.
I would like this subwindow to be a TEXTSW, but apparently I cannot
recieve ascii events from a TEXTSW, so I have made it a CANVAS. I can get
events from the canvas, cook the characters in an internal buffer, and use
pw_char to display the text in the canvas. The problem with this is that
I have had to write a hell of a lot of code to insert characters, maintain
a cursor, move it around, grow the pixwin as the text in it grows, etc.
All stuff that TEXTSWs do for free. I would like to support full
selection service stuff in this subwindow, but this is very hard, because
while I can get the pixels for any location in the canvas, I don't know
what characters they represent. I only know the characters which are in
the current line (my cooking buffer). It has also proved difficult to
handle long lines of entered text, because wrapping lines causes
headaches.
I am now to the point where I an willing to re-write a lot of code in
order to make this subwindow a TEXTSW like it really should be, but
getting events is still critical. Is there a way to overlay a TEXTSW with
a CANVAS so sunview will handle the character display in the TEXTSW, but I
can still get events from the canvas? Or, is there a way to get events
from TEXTSWs? Is this a sun bug?
John Oswalt (..!sun!megatest!jao)
More information about the Comp.sys.sun
mailing list