tkinter/tk memory questions

Edward K. Ream edream at tds.net
Wed Dec 4 16:38:47 EST 2002


"Jeffrey Hobbs" <JeffH at ActiveState.com> wrote in message
news:3DEE3CA4.6080400 at ActiveState.com...
> Edward K. Ream wrote:

> I would think that just using one text widget would suffice.  Did you know
> that you can elide (hide) portions of text in a text widget via tags?
That
> feature would be the key.  Just create tags that increase the lmargin and
> elide when they aren't supposed to be visible.

Hmm.  I suppose this would be possible.  The present code has the advantage
of mimicing the Windows Explorer look and feel.  For that a canvas is
natural and good, I think.

> tkman is an app that makes good use of the elide feature (in fact, was the
> impetus behind getting it in the core), for another example.  It adds
little
> arrow graphics (images can of course be placed inline in text) to indicate
> where elided (elidden?) text is, just as you would want for outlines.

Thanks for this pointer.  I'll look at tkman for reference.

> That way you only use one widget for everything, if I understand the
basics
> of your intentions.  I do know that if what you want is essentially the
> outline feature of PowerPoint (to take a concrete example), that could be
> all done within one Tk text widget.

In my app using a single text widget would not be convenient. Anyway, I have
something that works, and seems good enough to me, especially since it no
longer leaks :-)

Leo 5.x will allow graphics to be embedded in the main text pane, so
eventually Leo will be using much more of the Tk.Text widget's power.

Edward
--------------------------------------------------------------------
Edward K. Ream   email:  edream at tds.net
Leo: Literate Editor with Outlines
Leo: http://personalpages.tds.net/~edream/front.html
--------------------------------------------------------------------





More information about the Python-list mailing list