[Tkinter-discuss] multicolumn list/tree with images

Michael Lange klappnase at web.de
Fri Feb 16 17:49:09 EST 2018


On Fri, 16 Feb 2018 22:06:58 +0100
<c.buhtz at posteo.jp> wrote:

> Dear Michael,
> 
> thank you very much for your valuable reply.
> 
> > there does not seem to be a way to
> > make only the "checkbutton" icon sensitive to mouse clicks
> 
> The event object have the exact coordinates of the click position.
> Based on them you can identify the row and column. Quick & Dirty
> example
> 
> def on_click(event):
>     iid = event.widget.selection()[0]
>     col = event.widget.identify(component='column',
>                                 x=event.x, y=event.y)
>     print('iid: {} column: {}'.format(iid, col))
> 

Yes, but that column includes a few pixels of white space on the left of
the checkbox and a few pixels of space (including the space the "active"
rectangle takes) to the checkbox's right. At least I could not find a way
to work around this without having to try something rather fancy with
absolute screen coordinates which I thought would not be worth the effort
and besides bear potential for bugs.

> 
> > There are several third party solutions available, though.
> 
> I know. But I had some problems with their documentation, missing
> support channels, inactive community, unclear project status, ...
> 
> > TkinterTreectrl is a wrapper for the tktreectrl tcl extension
> > ...
> > https://sourceforge.net/projects/tktreectrl/
> > https://sourceforge.net/projects/tkintertreectrl/
> 
> What is the difference compared to tkinter.Treeview?
> What is the difference between your two links? Which one is more active
> and up to date? There is also a fork on GitHub where I opened an Issue
> about project status
> https://github.com/apnadkarni/tktreectrl/issues/1
> No examples no documentation.

To learn about the difference between the ttk.Treeview and the tktreectrl
widget I would like to be able to point you to their web page, but
unfortunately sf still appears to be in service. There is an archived
page available at:
https://web.archive.org/web/20170301130644/http://tktreectrl.sourceforge.net/

Just look at the screenshots and you will get an idea about how much more
capable this widget is than the ttk Treeview.
The difference between the two links is, that *tktreectrl* is the tk
extension library (written in C, windows binaries are available on the sf
download site, linux binaries included in most recent distributions) and
*tkintertreectrl* is a Python wrapper module I wrote for it (both
Python2 and -3). The docs on sf are of course currently down with the rest
of their pages, but are included in the download, plus a few very simple
demos. In case of questions you can always ask me :)

> 
> > able to do this, like tablelist and maybe tktable, you can look at
> > this archived page for more information and download links:
> > 
> > https://web.archive.org/web/20140412080251/http://tkinter.unpythonic.net:80/wiki/Widgets
> 
> Very important link - good to have the archive!
> 
> I checked the links: Some dead, some unclear about project status,
> features, screenshots, docu. I wrote some mails, issues and bug-tickets
> to be clearer in this points.
> 
> "TkTable"
> https://sourceforge.net/p/tktable/bugs/318/

I guess I could answer what you asked there :)
The last release was made in 2008. I bet it still works :)

> 
> Very interesting sounds the "The Multi-Column Listbox and Tree Widget
> Package Tablelist 6.0" where screenshots are available, too.
> <http://www.nemethi.de/>
> But it is pure Tcl code. I don't know how to use that with Python3.
> There is some quick and dirty code around on the web. But no official
> supported or infos about how much it fits to the Tcl code. No
> repository or support channel.

Kevin Walzer's python wrapper for tablelist is available here:
https://web.archive.org/web/20150920011432/http://tkinter.unpythonic.net/wiki/TableListWrapper

Looks like Python2 only, but it shouldn't be a problem to adapt it to
Python3. Personally I never used it, but I have been hearing good things
about it. I think Kevin probably still reads the list, so if you ask
questions about it here there might be a good chance to get help.

> 
> Pmw megawidgets
> <https://sourceforge.net/projects/pmw>
> Website currently offline. No docu, no examples, no screenshots.

There is actually excellent documentation about Pmw on their page and
will hopefully soon be available again once sf have restored their
content. Probably downloads will still work, and they include the
documentation. However, unless something new showed up recently there is
no multi colomn listbox widget with icon support included.

> 
> > Finally there seems to be a tix.TList widget which might be able to do
> > what you want, though I never used it myself, see
> > https://docs.python.org/3/library/tkinter.tix.html
> The docu is currently offline.

Seems like right now we are learning something about the bad side effects
of monopoly structures... :)

> Don't know how to use or if it fit my
> needs. The little words about tix in the official Python3 docu doesn't
> help. No code no examples no features or screenshots.

Probably the pydoc documentation is of more help. Or just look into
tix.py :)
Tix itself comes with a number of tcl demos, which maybe give you
an impression.

> 
> That is the situation.

Agreed :)

Best regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

The sooner our happiness together begins, the longer it will last.
		-- Miramanee, "The Paradise Syndrome", stardate 4842.6


More information about the Tkinter-discuss mailing list