Re: [Tkinter-discuss] multicolumn list/tree with images

2018-02-18 Thread Michael Lange
Hi,

On Sun, 18 Feb 2018 13:53:27 +0100
 wrote:

(...)
> No docu about tix. There is only tcl code. No Python. The pydoc docu
> doesn't help, too. I don't see how to add columns to any of the listbox
> alike widgets or if is is even possible.

in debian there is a demo in the tix-dev package
at /usr/share/doc/tix/examples/tixwidgets.tcl where you can have a look
at the features of the tix widgets. But maybe you are right and tix
simply does not offer something of the kind you are looking for.

Best regards

Michael


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

Schshschshchsch.
-- The Gorn, "Arena", stardate 3046.2
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] multicolumn list/tree with images

2018-02-18 Thread c.buhtz
On 2018-02-16 23:49 Michael Lange  wrote:
> > > 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.

No docu about tix. There is only tcl code. No Python. The pydoc docu
doesn't help, too. I don't see how to add columns to any of the listbox
alike widgets or if is is even possible.
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] multicolumn list/tree with images

2018-02-16 Thread Michael Lange
On Fri, 16 Feb 2018 22:06:58 +0100
 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.
> 
> 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
> 
> 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 

Re: [Tkinter-discuss] multicolumn list/tree with images

2018-02-16 Thread c.buhtz
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))


> 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.

> 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/

Very interesting sounds the "The Multi-Column Listbox and Tree Widget
Package Tablelist 6.0" where screenshots are available, too.

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.

Pmw megawidgets

Website currently offline. No docu, no examples, no screenshots.

> 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. 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.

That is the situation.
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] multicolumn list/tree with images

2018-02-15 Thread Michael Lange
Hi,

On Wed, 14 Feb 2018 01:26:20 +0100
 wrote:

> On 2018-02-14 01:14  wrote:
> > But I need images as values. I don't want to use column '#0' for
> > images. Images should appear in the second column for example.
> 
> A workaround would be to keep the '#0' column with the image.
> But I need to remove the tree space (some pixel on the left of the
> picture) because I don't need a tree. But show='headings' would remove
> the complete '#0' column with the image.
> 
> I need an image in each list row as small button. The user can use this
> as a flag to mark some rows.

I have a similar setup in one of my apps, where I use a "checkbutton"
image in col #0 so the user can select or deselect a list entry. It
works, but is not perfect, though: there does not seem to be a way to
make only the "checkbutton" icon sensitive to mouse clicks, so the
"checkbutton's" state changes even when the user clicks somewhere in col
#0 next to the icon. And the "active rectangle" appears only as a tiny
dotted rectangle between the icon and the text which is in col #1.
The setup I use, which apart from the above issues I think looks good
enough, is

treeview.configure(show=('tree', ), columns=('foobar',))
treeview.column('#0', width=35, stretch=0)

Best regards

Michael

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

Live long and prosper.
-- Spock, "Amok Time", stardate 3372.7
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] multicolumn list/tree with images

2018-02-15 Thread Michael Lange
Hi,

On Wed, 14 Feb 2018 01:14:53 +0100
 wrote:

> I experimented with tkinter.ttk.Treeview and tkinter.Listbox on Python3.
> 
> I need a list widget with multiple columns (this could be Treeview).
> But I need images as values. I don't want to use column '#0' for
> images. Images should appear in the second column for example.
> 
> Tk itself has a treectrl. Maybe it is possible with it? But I don't
> know how to use this with Python3.
> 
> Maybe there are other third party solutions around?

with ttk.Treeview you can add images only to the first column.

There are several third party solutions available, though.
TkinterTreectrl is a wrapper for the tktreectrl tcl extension and
contains a multi column listbox class that can be set up to use images in
any column:
https://sourceforge.net/projects/tktreectrl/
https://sourceforge.net/projects/tkintertreectrl/
(seems like sf's project pages are down today, but downloads are
possible).

There are some other alternatives that I (being somewhat biased
towards the treectrl :) have never been using myself, which should be 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

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

Best regards

Michael


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

You'll learn something about men and women -- the way they're supposed
to be.  Caring for each other, being happy with each other, being good
to each other.  That's what we call love.  You'll like that a lot.
-- Kirk, "The Apple", stardate 3715.6
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


Re: [Tkinter-discuss] multicolumn list/tree with images

2018-02-14 Thread c.buhtz
On 2018-02-14 01:14  wrote:
> But I need images as values. I don't want to use column '#0' for
> images. Images should appear in the second column for example.

A workaround would be to keep the '#0' column with the image.
But I need to remove the tree space (some pixel on the left of the
picture) because I don't need a tree. But show='headings' would remove
the complete '#0' column with the image.

I need an image in each list row as small button. The user can use this
as a flag to mark some rows.
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


[Tkinter-discuss] multicolumn list/tree with images

2018-02-14 Thread c.buhtz
I experimented with tkinter.ttk.Treeview and tkinter.Listbox on Python3.

I need a list widget with multiple columns (this could be Treeview).
But I need images as values. I don't want to use column '#0' for
images. Images should appear in the second column for example.

Tk itself has a treectrl. Maybe it is possible with it? But I don't
know how to use this with Python3.

Maybe there are other third party solutions around?
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss