<br><br><div><span class="gmail_quote">On 5/31/06, <b class="gmail_sendername">Frank Goenninger</b> <<a href="mailto:fgoenninger@prion.de">fgoenninger@prion.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all:<br><br>Just a heads up on the behaviour of the text widget:<br><br>Currently setting the contents of the text widget is done by setting<br>the model value of the widget's model. This causes two steps to be<br>triggered as Tcl commands:
<br>1. Erase text widget to empty display<br>2. Set new text and display this text<br><br>Now, if one is reading file contents to be display to the widget by<br>using consequtive calls to read-line and setting each line as the new
<br>text widget content only the last line will be displayed, of course.<br>And if this happens to be an empty line then just nothing will appear<br>on the text widget.<br><br>In case you want to dig in deeper on that subject, well, we're here...
</blockquote><div><br>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.<br><br>(1) subclass text-widget<br>(2) define for that subclass an :around observer of .md-value that does nothing or "what you want"
<br>(3) add slots to your text-wdget subclass as needed and knock yourself out.<br><br>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.
<br><br>I'd hang out my shingle and suggest a contract, but this seems like a reasonable next step for you in re Cells fluency.<br><br>ken<br></div><br></div><br>