Show mailing list with Tkinter

Asked

Viewed 450 times

1

I’m doing a show in Tkinter that’s based on an e-mail box. I intend, in a Tkinter window to show an email list based on a directory with files .txt ( which are emails). I have been looking for a command to create a box and display txt names in lines but cannot find them. Does anyone know any?

  • Box like the Hotmail inbox for example. Show row by row as if in the Hotmail inbox. And each line corresponds to the emails.

  • http://imgur.com/I9hv9Lx Of this generic, but clear only in lines without so much detail and options.

  • Similar to: http://imgur.com/I9hv9Lx. Previous link was wrong, sorry.

1 answer

1

There is a widget called Treeview, that is part of the module ttk (a Tkinter sub-module), which allows you to have a kind of table where you can clearly add lines (or even a hierarchy of lines (one under another as if they were daughters of each other).

Here’s an example I created a long time ago where it shows you how to remove lines from a Treeview, clearly shows you also how to add (if not how to remove something that does not exist?).

https://github.com/dossan/tkinter/blob/master/other/howtos/remove_row_from_tree.py

You can also add "Event handlers" to specific lines. For example, if you wanted to call a function when you click a line, you can do so by applying those that are called "tags".

If you want to know more about this widget (and how to add "tags"), take a look at this fairly well written article and other examples:

http://www.tkdocs.com/tutorial/tree.html

Note that this article also has code for other programming languages other than Python, but you can specifically read code only in Python if you specify it on the right side above, in a drop down menu called "Show".

There are also other third-party bookstores that allow you to create even tables. For example, this here I have as a repository in my Github Account created by Guilherme Polo. But there are others, like tkintertable. If you couldn’t create your own table, too, but maybe it’s not worth it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.