[cells-devel] Celtk: Text widget API woes

Ken Tilton kentilton at gmail.com
Wed May 31 05:44:06 UTC 2006


On 5/31/06, Frank Goenninger <fgoenninger at prion.de> wrote:
>
> Hi all:
>
> Just a heads up on the behaviour of the text widget:
>
> Currently setting the contents of the text widget is done by setting
> the model value of the widget's model. This causes two steps to be
> triggered as Tcl commands:
> 1. Erase text widget to empty display
> 2. Set new text and display this text
>
> Now, if one is reading file contents to be display to the widget by
> using consequtive calls to read-line and setting each line as the new
> text widget content only the last line will be displayed, of course.
> And if this happens to be an empty line then just nothing will appear
> on the text widget.
>
> In case you want to dig in deeper on that subject, well, we're here...


Are you ready to solo? I do not think there is an off-the-shelf answer for
anything more sophisticated than what you see now in text-widget.

(1) subclass text-widget
(2) define for that subclass an :around observer of .md-value that does
nothing or "what you want"
(3) add slots to your text-wdget subclass as needed and knock yourself out.

What you can consider is an ephemeral "append-data" slot you will setf with
each line of input. The observer on that line does the insert-at-end thing.
md-value can have a rule that appends "append-data" to .cache. the md-value
is just there should other code want to get to it, though there is always
the text widget dump and cget (?) stuff.

I'd hang out my shingle and suggest a contract, but this seems like a
reasonable next step for you in re Cells fluency.

ken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cells-devel/attachments/20060531/22754b4f/attachment.html>


More information about the cells-devel mailing list