Version 12 of Perfect Aqua Look

Updated 2005-11-06 03:08:15

Aqua is the name of the native MacOS X look.

Even with the help of tile, Tk applications do not yet look fully native out of the box. It is, however, possible to improve the look of the default widgets with careful settings. This page collects some of them:

  • White border around Tk widgets : Some Tk widgets that do not yet have a tile equivalent, such as tk_optionMenu, display a white border around them that make them stand out against regular OSX pinstripe background. It is possible to minimize this effect with : -borderwidth 0 -bg #ececec

Lars H: Does that address a different issue than that which is addressed by setting the -highlightbackground? Cf. discussion at the end of button.

  • Tile's scrollbars are not the Aqua ones, whereas recent versions of Tk without Tile use the native Aqua scrollbars. Why is this?

JH - See Aqua toplevels for some ideas to rework toplevel handling. On a semi-related note, check out Going Native with Komodo's GUI Builder, which has before and after pics of the aqua porting attempt.

MAK - The current architecture of the layout system isn't very conducive to it (yet). The problem is, Tile wants to be able to theme, draw and handle events for individual elements (e.g. the up arrow, the down arrow (of which there might be multiple), the slider, etc.), whereas the Appearance Manager (the Apple API for drawing control elements) doesn't factor things out that far. To draw a scrollbar with Appearance Manager, you call one API to draw the trough (which also draws the arrows) and one API to draw the slider; and it doesn't *actually* draw either of them until you call the APIs to draw both. The situation is similar with Qt, I hear. I don't know if Joe has a plan for how to deal with it or not yet, but I think (and I seem to recall him hinting that) the thing to do is probably to use the full Aqua scrollbar setup, and if you want to change any part of it you have to theme the whole thing, rather than just e.g. the arrows. But there are probably complications to deal with for event handling, since there's no "arrow" element to do bindings for. The combobox isn't perfect, either, for similar reasons.. In that case, there isn't even an Appearance Manager API to draw the right button shape for comboboxes, and there are problems with Tk's handling of wm overrideredirect and wm transient under Aqua (and, unfortunately, event handling for more appropriate Aqua-specific window styles). So "perfect" comboboxes under Aqua may have to use a complete Carbon control.

Kevini Walzer - See http://www.wordtech-software.com/aquify-tk-app.html for documentation that discusses some practical considerations in making Tcl/Tk applications conformant with the Apple HIG.


Category GUI See also TclTkAquaBI