[ltk-user] Example of scrollbar available?

edgar edgar-rft at web.de
Fri Dec 13 22:46:11 UTC 2013


Fri, 13 Dec 2013 11:12:15 +0100
Josef Wolf <jw at raven.inka.de> wrote:

> Do I really need to learn tcl when I want to use ltk? =8-O

You do not necessarily *need* to learn Tcl/Tk to use LTK, but if you
don't know what you are doing you are doomed to write shitty programs.
That is true for every programming language.

>> A picture how this looks like can be found here:
>> http://incrtcl.sourceforge.net/itcl/mmc/full/catalog.gif
>> 
>> The text browser on the left side contains small black triangles
>> to expanded and/or collapse the text under the headlines.
>> 
>> Is that what you want?  
>
> That's pretty close. Things that I need which might be missing
> in such a browser are:
>
> - preview/rename/move/remove files within a branch (possibly modifying
>   file hierarchy)
> - move files from one branch to another
> - rename branches
> - merge branches

Such things are provided by *no* GUI toolkit I know, so it will be
your task to add this functionality e.g. by binding Lisp functions
to mouse-clicks or other GUI events.

>> I have a copy of "Effective Tcl/Tk Programming" and we could try
>> to re-implement the browser widget in LTK.  
>
> That would be great!

I just realized that Tcl/Tk 8.6 has a ttk::treeview widget

man page http://www.tcl.tk/man/tcl/TkCmd/ttk_treeview.htm
examples http://wiki.tcl.tk/20065

LTK supports the ttk::treeview widget by:

#:treeview
#:treeview-delete
#:treeview-focus
#:treeview-exists
#:treeview-insert
#:treeview-item
#:treeview-column
#:treeview-heading
#:treeview-move
#:scrolled-treeview
#:treeview-get-selection
#:treeview-identify
#:treeview-identify-item
#:treeview-set-selection

The advantage of using the ttk::treeview widget would be that
the LTK classes and methods already exist, the advantage of
porting the "Effective Tclk/Tk" browser would be that it can
be easily extended, it is implemented in Tcl/Tk (not in C).

The disadvantage of the ttk::treeview widget would be that it
doesn't exist in Tcl/Tk version before Tcl/Tk 8.6.

I already have downloaded the "Effective Tclk/Tk" code and will
try to make a LTK megawidget out of it over the weekend, but
I will promise nothing until the code really works... 

- edgar



More information about the ltk-user mailing list