Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to set ttk::treeview tree label width

406 views
Skip to first unread message

Zhang Weiwu

unread,
Apr 1, 2010, 11:05:00 PM4/1/10
to
Hello. Haven't see this asked here before nor google useful in this case.

I can easily change the width of every column in a ttk::treeview but how
do I change the width of the tree label? Which is a "column" placed
before column #0 and don't have a column name (as far as I know).

Since ttk::treeview doesn't have a widget option '-width' I see no where
I can specify the width of the tree label.


Sorry, newbie question. Thanks in advance.

Arjen Markus

unread,
Apr 2, 2010, 8:24:11 AM4/2/10
to

You can use the command:

$tree column $column -width $width

for that.

Regards,

Arjen

Zhang Weiwu

unread,
Apr 4, 2010, 10:08:27 PM4/4/10
to
Arjen Markus 写道:

> You can use the command:
>
> $tree column $column -width $width
Hi. Perhaps I didn't make this clear, but my original post questioned
what is the $column for tree label.

Column #0 is the first one next to tree label, so if I guess, the tree
label must be sitting in column #-1, which I tried, doesn't work.
Besides, you don't need a variable (i.e. $column) to specify tree label,
since there is only one tree label that you can specify to, and it is
always the same position and order....

MSEdit

unread,
Apr 6, 2010, 3:31:02 AM4/6/10
to

I am not sure what treeview you are using but on my system the #0
column is the tree part.

try opening a console in your app
console show
then type
parray ::ttk::treeview::State
the 'heading' entry gives the column for the last header clicked on
with the mouse button.

click on the heading and redo the parray command

Martyn

Zhang Weiwu

unread,
Apr 6, 2010, 2:05:17 PM4/6/10
to
MSEdit 写道:

> I am not sure what treeview you are using but on my system the #0
> column is the tree part.
>
Hi. Thanks for your time. You are right #0 is the tree part, which means
I asked a wrong question. I took #0 as "an integer of value 0", later I
realized it actually means "a string that is # followed by a zero
character". My problem is easily solved by prefixing the $column_nr with
"#". I had to admit without your test case ("parray
::ttk::treeview::State") it would be rather difficult for me to find out
the problem just by describing and communicating, as whenever I
communicate with other people I could make the same mistake again.
0 new messages