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

Changing fonts in a ttk::treeview cell

552 views
Skip to first unread message

dwto...@googlemail.com

unread,
Dec 3, 2007, 5:09:18 AM12/3/07
to
Hi all,

I am currently updating my Tk application to use the new ttk themed
widgets. I am using version tk8.5.b3.

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.

thanks,

dan.

Joe English

unread,
Dec 5, 2007, 10:35:28 AM12/5/07
to
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

0 new messages