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

Changing Tk theme under Windows

43 views
Skip to first unread message

Silas Justiniano

unread,
Sep 16, 2005, 2:07:42 PM9/16/05
to
Hello!

I see tk widgets has the same appearance than win32 native controls...
grid command seems very ugly, and I'd like to make the appearance like
Linux control.

Is it possible?

Thank you! Bye!

Larry W. Virden

unread,
Sep 16, 2005, 2:11:41 PM9/16/05
to
The only way to get a non-windows look and feel on windows would be to
call widgets other than the ones built into Tk by default.

Bryan Oakley

unread,
Sep 16, 2005, 2:47:20 PM9/16/05
to
Larry W. Virden wrote:
> The only way to get a non-windows look and feel on windows would be to
> call widgets other than the ones built into Tk by default.
>

... or start using tk 8.5 with the tile extension. Tile provides the
ability to select from different themes, as well as create your own styles.

http://tktable.sourceforge.net/tile

Larry W. Virden

unread,
Sep 16, 2005, 5:18:56 PM9/16/05
to
So with Tile, on windows you can make the widgets all look like the
Linux widgets? I thought that wasn't possible.

Bryan Oakley

unread,
Sep 16, 2005, 5:40:13 PM9/16/05
to
Larry W. Virden wrote:
> So with Tile, on windows you can make the widgets all look like the
> Linux widgets? I thought that wasn't possible.
>

It's possible. Tile rocks.

Realize, though, that it only works if you use the tile widgets. It
doesn't make the standard tk widgets look different. You have to change
your application to use commands like "ttk::button", "ttk::frame", etc.
rather than "button", "frame", etc.

Fortunately, tile includes replacements for all widgets that require
theming, and some additional ones as well. You don't get a themed canvas
or text widget since there's really nothing there that theming can do
other than set the background color which you can already do with
regular widgets.

Silas Justiniano

unread,
Sep 17, 2005, 12:02:57 PM9/17/05
to
What about change Tk standard widgets to tile? Are tile commands
similar to tk standard or may I rewrite my code?

Thank you! Bye!

Bryan Oakley

unread,
Sep 17, 2005, 12:21:07 PM9/17/05
to
Silas Justiniano wrote:
> What about change Tk standard widgets to tile? Are tile commands
> similar to tk standard or may I rewrite my code?

Similar? Yes. Drop-in replacements? No. Tile widgets have fewer and
different options, and their notion of "state" is different than
standard tk widgets.

That being said, it's pretty easy to switch to using tile widgets. Just
use ttk::button instead of button, etc, then throw away almost all
command line options (for example, instead of "button .b -font whatever
-background whatever ..." you would simply do "ttk::button .b").

Switching to tile will require manually rewriting some of your code, but
how difficult that is depends on your code. If you almost exclusively
rely on widget defaults the transition will be very easy. If you rely on
lots of explicit options (borderwidths, backgrounds, etc) you'll have
more work to do.


Larry W. Virden

unread,
Sep 19, 2005, 1:22:25 PM9/19/05
to
> You don't get a themed canvas
or text widget since there's really nothing there that theming can do
other than set the background color which you can already do with
regular widgets.


Perhaps you can do this with the regular widgets, but wouldn't it be
better to be consistent, so that one wasn't bouncing between widget
sets?

Also, it seems unfortunate that if the tile widgets are written to take
advantage of themes, that text, canvas, etc. at least have tile
wrappers to pick up the colors from the theme and apply them.

Thanks for the update though; I wasn't aware that Tile actually allowed
one to take one's windows gui program back to the original look and
feel of Tk.

0 new messages