|
From: Joe E. <jen...@fl...> - 2006-01-30 00:33:58
|
[ CC: tktable-tile-dev, as this is probably of general interest ] Jeff Hobbs wrote: > > I looked into the ttk::frame usage for the tklib widget package, > but it's handling of -borderwidth / -relief is not consistent > with tk::frame's. It appears to be locked at 1/2 pixels, based > on -relief, with -borderwidth essentially ignored. [ Depends on the theme -- see below ] > Joe - what is the intention with that support? Steve was > asking because I was avoiding using it due to lack of -bd > support, but that was a problem in some megawidgets that expose > the tk::frame background (like a scrolled window). The -relief/-borderwidth issue is one of the areas where 8.4-compatibility and theme-appropriate appearance are still fighting it out, with no clear winner as of yet. The current policy (which is not entirely satisfactory) is: (1) the ttk::frame widget honors any user-specified -borderwidth when computing internal padding, but (2) the Frame.border element may draw a thinner border if necessary. Also, (3) the Frame.border element should make a best-effort attempt to honor -relief, but it's allowed to substitute a "morally equivalent" border in case the Motif style is visually incompatible with the rest of the theme. Without #1, it's impossible for applications to reliably get widget alignment right in complex layouts. But on the other hand, it's not always possible to draw an appropriate border with an arbitrary thickness. (For example, the Win32 DrawEdge() routine draws borders that are SM_C[XY]EDGE pixels thick -- the caller doesn't have any say in the matter.) Hence #2. #3 is understandably controversial, and might be changed. The original reason for this was that the ttk::labelframe widget had a built-in default of '-relief groove' (for BWidget compatibility); but on Windows XP and Aqua, you really, really don't want labelframes with a grooved border. Now that we've abandoned all pretense of supporting the 'namespace import' trick, labelframes can have a NULL default for -relief, and #3 can probably be revisited. --Joe English jen...@fl... |