From: Jim D. <jim...@gm...> - 2007-12-14 00:16:43
|
I'm getting back up to speed on Tk for the Mac. I have a few questions, mostly about differences between X11 Tk and the Aqua variety. I realize these aren't necessarily bugs, as Aqua integration surely comes with some constraints, so I'm sharing them here to seek your insight. Forgive me if any of these points have been addressed in previous patches or discussions. I'm using the universal Aqua 8.4.16 Tclkit (http://www.equi4.com/pub/ tk/8.4.16/tclkit-darwin-univ-aqua.gz) on Mac OS X 10.4.11. Comparisons to X11 were made with the corresponding Tclkit (tclkit- darwin-univ 8.4.16). 1 The menubutton does not seem to give visual indication of its disabled state. For instance, the following menubutton widgets appear the same: pack [menubutton .m1 -text Normal -state normal] pack [menubutton .m2 -text Disabled -state disabled] whereas disabling a regular button results in recognizable faded appearance: pack [button .b1 -text Normal -state normal] pack [button .b2 -text Disabled -state disabled] The discrepancy is also apparent when the window does not have focus. Most controls adopt their disabled appearance in this context, but the menubuttons appear normal. In contrast, disabled menubuttons in X11 Tk do appear faded. 2 To permit the main window to be resized horizontally but to prevent vertical resizing, I issue this command: wm resizable . 1 0 However, this prevents me from resizing the window at all. It differs from explicitly disabling resizing in that the resize grip remains visible. Issuing [wm resizable . 0 0] prevents resizing and conceals the grip. In all cases, [wm resizable .] reports the requested configuration correctly, even if I cannot actually resize the window. 3 The bonus "All Documents" type does not function as expected in tk_getOpenFile with -typelist. tk_getOpenFile -filetypes {{"Starkits" {.kit}}} In this example, "Starkits" appears in an "Enable:" popup menu at the top of the file dialog, and, as expected, only files ending in ".kit" are selectable. However, an "All Documents" item appears automatically at the bottom of the "Enable:" menu. Selecting this item does not necessarily allow all documents to be selected - the same files remain selectable as were before choosing "All Documents". Happily, the conventional wildcard type works fine: tk_getOpenFile -filetypes {{"Starkits" {.kit}} {"All Files"} {*}}} What does the "All Documents" item do? 4 I've found that [tk_setPalette systemMenu] yields a subtle background texture that matches the "default" window texture, at least on Mac OS X 10.4. (For instance, it matches the background of new windows created in Interface Builder.) Is this the "canonical" way to get this appearance? 5 What is a recommended way to test if Tk Aqua is running? How about [namespace exists tk::mac]? Testing tcl_platform(os) and (platform) reports Darwin and unix, respectively, whether I'm using the X11 or Aqua version. Confirmation or clarification of any of these points is appreciated. Likewise, please ask if you need more detailed examples. Thanks for your help! Jim |