Question

import Tkinter, ttk
root = Tkinter.Tk()
tree_view = ttk.Treeview(root)
tree_view.pack()
test_id = tree_view.insert('', 0, text = "test")
root.mainloop()

This displays a window:

enter image description here

Notice the margin left of "test".
Is it possible to retrieve/set the value of this margin?

Was it helpful?

Solution

The "margin" appears to be a place where "plus" and "minus" icons are displayed for tree items.
To hide it:

import Tkinter, ttk
root = Tkinter.Tk()
tree_view = ttk.Treeview(root, show='headings', columns=('1'))
tree_view.pack()
tree_view.insert('', 'end', values = ('test'))
root.mainloop()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top