Subject: Changing fonts in a ttk::treeview cell
From: Joe English
Date: 12/5/2007 3:35:28 PM
dwtowner wrote:
>
> I am using a ttk::treeview to display data items. Some of those data
> items are bits of code, and so need to be displayed in a fixed-width
> font, while other items can be displayed in whatever font the system
> chooses. Is it possible for ttk::treeview to override the fonts in
> some cells, while leaving others to use the default?
>
> Initially I believed that the `item -tags' command did what I wanted -
> analogous to the way that `item -values' sets the values for each
> column, I thought that `item -tags' might have set the tag for each
> column - but experimentation suggestions that this isn't the case.
The item -tags option specifies a list of tags that apply to the
entire item. There is at present no way to specify settings
for individual columns or individual cells.
A planned future enhancement is to apply tag $columnID when
drawing a cell in that column. That way different columns
will be able to have different display options (but only for
the column as a whole, there is no plan to add per-cell tags
at this time.)
--Joe English
|