[Tkinter-discuss] Treeview with a single column header

craf pyclutter at gmail.com
Wed Apr 6 23:52:46 CEST 2011


-----Mensaje original-----
De: Emiliano Gavilán <emilianogavilan at gmail.com>
Para: tkinter-discuss at python.org
Asunto: Re: [Tkinter-discuss] Treeview with a single column header
Fecha: Wed, 6 Apr 2011 17:49:09 -0300

...
> The problem is that the title puts me in a second column and the data in
> the first.

>The 'text' option of the insert method is for the tree column. To insert
>values on the other columns use the 'values' option, or the set method
>after the item is inserted.

>You can also control whether the tree column is shown or not with the
>'show' option.

>--CODE------------------

>import Tkinter
>import ttk

>master = Tkinter.Tk()

># add  show=['headings']  to hide the tree column
>tabla = ttk.Treeview(master, columns=['widgets'])
>tabla.heading('widgets', text='Item')
>tabla.pack()

>item = tabla.insert('', 0, text='In the tree', values=['date1'])
># values can be left out and instead use
># tabla.set(item, 'widgets', 'date1')

>master.mainloop()

>--CODE------------------

>Regards
>Emiliano

Hi Emiliano.

Thanks for the information!

Regards.

Cristian




More information about the Tkinter-discuss mailing list