From: Zhang Weiwu on
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.
From: Arjen Markus on
On 2 apr, 05:05, Zhang Weiwu <zhangweiwu+J...(a)realss.com> wrote:
> 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.

You can use the command:

$tree column $column -width $width

for that.

Regards,

Arjen
From: Zhang Weiwu on
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....
From: MSEdit on
On Apr 5, 4:08 am, Zhang Weiwu <zhangweiwu+J...(a)realss.com> wrote:
> 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....

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
From: Zhang Weiwu on
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.