tkinter/tk memory questions

Jeffrey Hobbs JeffH at ActiveState.com
Wed Dec 4 12:33:10 EST 2002


Edward K. Ream wrote:
>>I could think of more efficient ways to create an outline, but that isn't
>>the point of this post ...

> Hey, let's make it the point of this post :-)  I would be most interested in
> whatever hints you could give me.

Well, I must admit that I've never created an outline program, but there
is a program called tkoutline, as well as a few others which do similar
things.

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.

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.

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.

-- 
     Jeff Hobbs                     The Tcl Guy
     Senior Developer               http://www.ActiveState.com/
         Tcl Support and Productivity Solutions




More information about the Python-list mailing list