How to change ttk.Treeview column width and weight in Python 3.3 -


i have created gui application tkinter. using treeview widget. unable change column widths , weights. how properly?

sample:

tree = treeview(frames[-1],selectmode="extended",columns=("a","b")) tree.heading("#0", text="c/c++ compiler") tree.column("#0",minwidth=0,width=100)  tree.heading("a", text="a")    tree.column("a",minwidth=0,width=200)   tree.heading("b", text="b")    tree.column("b",minwidth=0,width=300)  

as far understand should create 3 columns widths: 100,200 , 300. nothing happens.

treeview.column not have weight option, can set stretch option false prevent column resizing.

from tkinter import * tkinter.ttk import *  root = tk() tree = treeview(root,selectmode="extended",columns=("a","b")) tree.pack(expand=yes, fill=both) tree.heading("#0", text="c/c++ compiler") tree.column("#0",minwidth=0,width=100, stretch=no) tree.heading("a", text="a")    tree.column("a",minwidth=0,width=200, stretch=no)  tree.heading("b", text="b")    tree.column("b",minwidth=0,width=300) root.mainloop() 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -