Oct-18-2021, 05:31 PM
(This post was last modified: Oct-18-2021, 05:40 PM by Yoriz.
Edit Reason: Added prefix
)
Now comes the next question, this time regarding tkinter.ttk.Treeview
Is there a way to embed a treeview as a row inside another treeview? The reason I ask is that the structures I want to show inside the (outer) treeview look like this:
I guess this is more a tkinter question than a python question, but I'm hoping someone can give me a start at the above -- much as you all straighened out my misapprehension about the list.remove() thing (which is solved, by the way -- thank you!)
Is there a way to embed a treeview as a row inside another treeview? The reason I ask is that the structures I want to show inside the (outer) treeview look like this:
+---------------+--------------+-------------------+ |Project Name | Start Date | | +---------------+--------------+ | |[+] Foo | 2021/10/10 | | | +-----------------+--------+----------------+ | | | Name | Emp ID | Department | | | +-----------------+--------+----------------+ | | | Marlon Brando | 00001 | Public Affairs | | | | James Dean | 00002 | Accounting | | | | Elvis Presely | 01467 | Liasion | | | +-----------------+--------+----------------+ | |[+] Bar | 2021/12/25 | | | +-----------------+--------+----------------+ | | | Name | Emp ID | Department | | | +-----------------+--------+----------------+ | | | Charlie Chaplin | 02001 | Public Affairs | | | | Larry | 02002 | Woodshop | | | | Curly | 02467 | Painting | | | +-----------------+--------+----------------+ | etcIt appears that Treeview can only handle homogenous rows, unfortunately. I know I could do it like this:
+---------------+------------+---------------+--------+----------------+ | Project Name | Start Date | Name | Emp ID | Department | |[+] Foo | 2021/10/10 | | | | | | | Marlon Brando | 00001 | Public Affairs | | | | James Dean | 00002 | Accounting | | | | Elvis Presely | 01467 | Liasion | etcbut that doesn't work well if there are more than a couple of fields for both the outer and subordinate rows.
I guess this is more a tkinter question than a python question, but I'm hoping someone can give me a start at the above -- much as you all straighened out my misapprehension about the list.remove() thing (which is solved, by the way -- thank you!)