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

Changing font color/size and background color with Tile

15 views
Skip to first unread message

Robert Lipman

unread,
Feb 23, 2006, 2:57:18 PM2/23/06
to
Hi,

I'm beginning to use Tile and I would like to be able to change the
font color/size and background color of the checkbutton widget on an
individual basis. I understand that I can use style to change it for
all of the checkbuttons, but I need to do it one-by-one. It seems like
I need the -style option on checkbutton, but I'm not sure what to do.

ttk::checkbutton -text "mytext" -variable myvar -style ???

Also how can I return what the name and size of the current font is in
Tile for a particular widget?

Thanks,

Bob Lipman

Joe English

unread,
Feb 23, 2006, 7:41:02 PM2/23/06
to
Robert Lipman wrote:

>I'm beginning to use Tile and I would like to be able to change the
>font color/size and background color of the checkbutton widget on an
>individual basis. I understand that I can use style to change it for
>all of the checkbuttons, but I need to do it one-by-one.

If you need to do this sort of thing, then you probably don't want
to use the Tile widgets. Stick with core Tk checkbuttons; the
Tile checkbutton isn't designed to accommodate this usage pattern.

>Also how can I return what the name and size of the current font is in
>Tile for a particular widget?

Unless you've explicitly specified something different, it's TkDefaultFont.
(Exceptions: ttk::treeview widgets use *two* fonts -- TkDefaultFont
and TkHeadingFont -- and ttk::entry widgets use TkTextFont.)

Use [font configure TkDefaultFont] to find out the size, weight,
and family of the default UI font on the current platform; and
see $tile_libdir/fonts.tcl and TIP#145 for details on how it
gets chosen.


--Joe English

0 new messages