Re: Directory/file browser as TreeView

On Wed, 27 Sep 2006 16:53:21 +0200
"Ratcliffe, Jeffrey (Peters)" <Jeffrey Ratcliffe External eads com> wrote:

Don't know if this is worthy of a/the cookbook or wiki somewhere, and it certainly needs tidying up (having 
to store the directory path as a hidden column seems rather hackish to me - but I couldn't work out how to 
get the parent from an iter) but having sort of got my head around TreeModel/TreeView/TreeStore to code a 
directory tree viewer I thought I'd save someone else the trouble.

Improvements, of course, are welcome.

Improvements? No.
Discussion, yes. :-)

I was working on the same thing awhile back, and found 2 problems
with this simple method, which I couldn't solve, which led me to take
it to a canvas instead.

1. Minor.  You can't adjust the size of the little rotating triangle, and it can be
   hard to click and see turn.

2. Major. It is slow to build the tree on huge directories with many nested
    subdirs. You can click and nothing happens( while it builds a 600Meg tree),
    and you will then start clicking twice, etc.  So it's kind of unusable on big
    trees, but pretty neat for small ones.
    It would be nice if you could figure a way to only grab the first level subdirs
    under a listing, and dynamically add to it. But I couldn't figure that out. :-)
    I think that is what you are referring to in your text above.

It also would be nice to have a background image.

To address these problems, I went to the canvas.
I made a Tk version to do this at

and I started on a Gtk2 Canvas version but got sidetracked.

Thanks for the finished script. It will come in handy. :-)

I'm not really a human, but I play one on earth.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]