Version 2 of Directories & Trees

Updated 2013-02-07 20:20:11 by MG

Directories & Trees

Zipguy 2013-02-07 - You can find out my email address by clicking on Zipguy. On one drive, which is all mine (d:\), I've got 1228 Total Directories. They make lots of sense to me. To others, I don't know, but that's ok, because only I use them. I remember a TCL program I wrote which would allow me to "promote" a group of files to the parent directory. I have to switch directories a lot (thanks in part to starkit) when I'm working on them.

I've been toying with the idea of writing a halfway decent program, like one I've been using to display a filename, ext, size (/folder) and date all in one row. The program I've been using was written to implement Norton's Commander (nc), which was written around 1993, in a newer version and lanuage. It displays directories "side by side" panels, where you can navigate directories, either up or down, in either pane that you are in. Then you can copy/delete/move/view/rename files, or create/delete directories. It also has some more advanced features like (Icons to provide these features)

  • Back - Means to go backwards (like you do in you browser)
  • Copy (which brings up a dialog)
  • Move (which brings up a dialog)
  • Delete (which brings up a dialog)
  • Search (which brings up a dialog)
  • Edit
  • View
  • Pack (and Unpack)
  • Map (and Unmap) Network drives
  • Invert Selection (if you have a few files selected)
  • Select all
  • Unselect all
  • Select Group (which brings up a dialog)
  • Compare the two panels (which brings up a dialog)
  • Refresh
  • Tree (which brings up a dialog just like the one in tk_getOpenFile)
  • Options (which brings up a notebooked dialog)
  • Help (which brings up a dialog)
  • Exit

to name a few. This is what it looks like:

http://www.geocities.ws/thezipguy/misc/gyula_navigator.png

It was written in 2002! I think all in C++, by Gyula Bibernath, which was purchased by Wanai. There must have been a LOT of C++ code in there. You can see it here at Yahoo! [L1 ] or you can download the 32 bit version from nonags where I found it at http://www.nonags.com/freeware-gyulas-windows-navigator-1-26_802.html . If you go to the site where you'd expect to see it, it's not on there anymore :(. http://www.wanari.com . 10 Years has been a long time, and Norton's File Commander has been the most attempted re-written program, because it used to be be written for monochrome screens, and used to be a DOS program, back when memory was Extremely expensive. I think it was written in pure Assembler language (for speed).

So I thought I'd look at things that would be good at handling Multicolumn listbox'es or switching directories, and I got a little lost here in wiki. I found then tablelist vs mclistbox afterwards which does support images as a column which sounded great. So I then went to http://www.nemethi.de , downloaded http://www.nemethi.de/tablelist/tablelist5_7.zip , got it installed on my computer, but unsucessfully :(. I'm still working on it. All the programs, which are demos, say:

http://www.geocities.ws/thezipguy/misc/tablelist_err.png

So I punted and tried to get mclistbox from http://tcllib.sourceforge.net , downloaded it, and it does work. The program that came with it, example.tcl, turned out to be a font selector, which I do like:

http://www.geocities.ws/thezipguy/misc/font_chooser.png

But it was not a file browser. Oops, I was in the wrong folder. So I made sure I was in the right folder, and ran example.tcl (in the correct folder, which was not D:\dl\dcl\stock\zip\combobox\example.tcl which I got from http://www2.clearlight.com/~oakley/tcl/combobox/index.html ) and it was a directory browser:

http://www.geocities.ws/thezipguy/misc/mclistbox.png

Horray! Well it does work, but there are some features, it doesn't have, that I've grown real attached to. Some to mention are compared in tablelist vs mclistbox. I wish I had tablelist working which I did back in 2005 in my aforementioned program which was the "promote" a group of files. I think it also used my own code (which I borrowed from wherever I got it, somewhere on here when it was called http://www.tcltk.com ) to have a combobox in there to make it easier to decide how many levels up you wanted to "promote" them to. Or perhaps I had a version of that program which allowed me to quickly go up 3-5 directories, and then proceed back down the tree. It's gotten a little lost in my memories, but I did like to use it when a group of files needed to be "promoted".

But anyway, not to get off subject, what about trees? I like the one that was supported in Gyula's Navigator which looked like this:

http://www.geocities.ws/thezipguy/misc/gyula_navigator_browse.png

which looked real good, but it was not re-sizeable. There was one in combobox which was at the "HugeCombo package" at http://wiki.tcl.tk/_repo/ulis/Hugecombo.zip , which was developed back in 2003, I downloaded it, unzipped it, and ran demo3.tcl in it, which looked like this:

http://www.geocities.ws/thezipguy/misc/hugecombo_demo3.png

and it did look pretty darn good. However it did not look as good with the "+" signs nor lack of them, and the lines that did look great in Gyula's version. So I went looking some more, and found another one which did look great (looking here http://wiki.tcl.tk/_//search?submit=Search&S=tree&_charset_=UTF-8 ), althought it appears on a canvas, not a listbox. It was at What's wrong with the tree widgets? which I downloaded and made it into a file, and it looked like this:

http://www.geocities.ws/thezipguy/misc/tree_graphic.png

which was wonderful. I'm still looking around for tree programs, which are smallish (not huge), and that I could give anyone credit for if I used it in my simple program that I'm trying hard to create. That is just one that let's you scroll around on your files, and move up and down folders (I mentioned at the bottom in Scrolled listbox widget -Display a list, pick any item then perform some follow up action.). I think that would be good for most TCL programmer's, if I could create one like that, that was not huge, would be great if I released it like I have ML - Heavily Modified & Improved, and it helped anyone to consider taking on the Norton Commander challenge. I'm just taking it one step at a time.

I'm still look around, because who would have thought that there are trees, many different versions, of different ages, out here somewhere. Also, what about Multicolumn listbox'es, are there many more of them hiding out here also?

Any help or comments on this would be welcome.

MG Have you looked at the ttk::treeview widget, which is part of Tk 8.5 and 8.6? It works as both a tree widget and a multicolumn listbox (either individually or both together).