Googling around for a solution I found the following note (Mon, 28 Apr
2008):
> ttk::treeview item height
> is essentially hardcoded: there's (currently) no (convenient) way
> to change it for individual items, or even for the widget as a whole.
> --Joe English
Is this still the actual state?
Trying "ttk::style element options treearea" doesn't show any option ...
I also had this issue, and my conclusion was that it is not
changeable... I haven't find a way to modify it...
George
I meant "haven't found"... :-)
George
This should do the trick (change the row height for the whole
widget):
set height 40
ttk::style configure Custom.Treeview -rowheight $height
$tree configure -style Custom.Treeview
Note that this option is undocumented, and it could go away
without notice, or the api changed, etc.
Regards
Emiliano
> set height 40
> ttk::style configure Custom.Treeview -rowheight $height
> $tree configure -style Custom.Treeview
>
> Note that this option is undocumented, and it could go away
> without notice, or the api changed, etc.
Thank you, Emiliano,
I have tested the configuration successfully on Linux and MacOSX with
the following parameters:
set points 16
set rowheight [expr {$points * 2}]
ttk::style configure Custom.Treeview -rowheight $rowheight
$tree configure -style Custom.Treeview
If $rowheight is less then the double of $points then the treeview
display is cut.
Zbigniew
Not completely. The "-rowheight" and "-indent" widget style options
are available:
ttk::style configure Treeview -rowheight $H -indent $I
(defaults are: -rowheight 20, -indent 20).
-rowheight applies to every item in the tree; there's still
no way to specify different heights for specific items.
--JE
That is correct -- it is undocumented, therefore subject to change
without notice, usual disclaimers apply, etc., etc., ...
However I'd give "-rowheight" a high probability of indefinite support,
so it's safe to use.
--JE