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...
Frank
On 5/31/06, Frank Goenninger fgoenninger@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:
- Erase text widget to empty display
- 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
Am 31.05.2006 um 07:44 schrieb Ken Tilton:
On 5/31/06, Frank Goenninger fgoenninger@prion.de wrote: Hi all:
...
[snipped my earlier message]
In case you want to dig in deeper on that subject, well, we're here...
Are you ready to solo?
??? What do you mean by that ?
I do not think there is an off-the-shelf answer for anything more sophisticated than what you see now in text-widget.
Yes, of course there is no better way to do this. I did not say otherwise. I just documented what is in there right now. I'll not do that again - I seem to understand you want me to stop contributing. I just do not get why right now.
(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.
That's obviously the way to go. I also never said otherwise.
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.
Sure. I know. I assumed you know that I know.
I'd hang out my shingle and suggest a contract, but this seems like a reasonable next step for you in re Cells fluency.
Sorry, You lost me here completely. What does that mean? Text widget and Tk is not about Cells. I do know perfectly well that I am a bloody beginner in re Cells. As for the text widget I'd say I did gain some experience (that I am ready to share).
Please enlighten me on how I did something I shouldn't have done. The only intention was to say "well, there is something you can use and if you do, don't be surprised it behaves like this." Because that's the thing I was trapped by. Assuming others might experience this also I "bursted out" into a few lines of a short notice - speaking from beginner to beginner.
Well, I may be wrong here as I might well misunderstand all of the underlying message of this reply, or, even, there is none - if so, I beg pardon for implying something which isn't there.
ken
Frank - having a big question mark in my mind
On 5/31/06, Frank Goenninger fgoenninger@prion.de wrote:
Am 31.05.2006 um 07:44 schrieb Ken Tilton:
On 5/31/06, Frank Goenninger fgoenninger@prion.de wrote: Hi all:
That is the part I missed. :) I thought you were writing to /me/ asking for help on the text widget.
kt
Am 31.05.2006 um 15:25 schrieb Ken Tilton:
On 5/31/06, Frank Goenninger fgoenninger@prion.de wrote: Am 31.05.2006 um 07:44 schrieb Ken Tilton:
On 5/31/06, Frank Goenninger fgoenninger@prion.de wrote: Hi all:
That is the part I missed. :) I thought you were writing to /me/ asking for help on the text widget.
kt
Oh, I really, really, really want to say a big "I am sorry" for having written a lengthy message about just nothing!!!
Back to hacking ;-)
Frank
That is the part I missed. :) I thought you were writing to /me/ asking for help on the text widget.
kt
Oh, I really, really, really want to say a big "I am sorry" for having written a lengthy message about just nothing!!!
Not at all, /my/ mistake in flipping exactly one bit made valid your entirely different interpretation. I would apologize but it has been worth the laugh. :) I needed a break from porting Cello to Celtk.
But last night was a good one and it is starting to be fun now. If I actually do this and get that Amazing Spinning Shapes Demo working* under an entirely different framework I will be smiling from ear to ear -- and we can start spamming the Cello list instead of Cells.
kenzo
* Unfortunately without the neat Glut built-ins such as sphere, torus, and <sob> teapot. k