Tkinter: multicolumn table widget

MRAB python at mrabarnett.plus.com
Tue May 31 18:18:27 EDT 2022


On 2022-05-31 21:29, Rich Shepard wrote:
> On Tue, 31 May 2022, MRAB wrote:
> 
>> Have a look at the tkinter.ttk.Treeview widget; it can be formatted as a
>> tree hierarchy, its name suggests, or a multi-column tables, but it
>> doesn't support multi-line text though, as far as I know.
> 
> MRAB,
> 
> Thank you, I will.
> 
> Each time I add a row to the contacts database table I include a note of
> what was discussed and what needs to be done. I'd like to be able to see the
> entire note with each contact event.
> 
> I'm not committed to using a table so I'm totally open to other approaches.
> My needs are few:
>     - The returned results are read-only.
>     - The number of rows returned are variable.
>     - Each row has a contact date, contact type, note, and next contact date.
>       The last one isn't necessary to be displayed, but the first three are.
>     - I want to be able to scroll and view all returned rows.
> 
The note could be displayed partially in the column itself, with the 
full text displayed either in read-only textbox nearby when the row is 
selected (and it's the only selected row), or in the form of a tooltip 
when you hover over it.

There's an example of how to show a tooltip here:

https://stackoverflow.com/questions/3221956/how-do-i-display-tooltips-in-tkinter

>> As with the tkinter.Text widget, you'll need to add the scrollbar(s) 
>> separately and then link them.
> 
> This I expected.
> 


More information about the Python-list mailing list