|
From: Joe E. <jen...@fl...> - 2005-08-12 16:14:18
|
Jeff Hobbs wrote: > I'm porting more stuff to OS X, and finding that the alternate > grouping controls (essentially labelframes) might be nice to > have. See: > > http://developer.apple.com/documentation/UserExperience/Conceptual/ > OSXHIGuidelines/XHIGLayout/chapter_19_section_4.html > > We should be able to reproduce these in styles, but the current > labelframe drawing disallows that. It has a -borderwidth, but > that is ignored for anything but adjusting the label inset (at > size 0, it still draws the border, Windows and OS X). > > On OS X it seems that for drawing themed groupboxes, there is > only the one API func. So I'm wondering ... is this an > instance of something tile styles should support, In principal, yes, this ought to be possible with custom styles, but it will be necessary to define a few new elements, and the labelframe layout algorithm needs to be generalized a bit more. > Essentially, I want the option: > labelframe .foo -style whitespace|bordered|separator You can almost get the "Whitespace" style with: style default Flat.TLabelframe -relief flat -borderwidth 0 This doesn't work at present, because the [ttk::labelframe] has non-NULL defaults for -relief and -borderwidth, which will take precedence. I'm starting to think that these should be removed altogether (-relief in particular; Tk's standard set of -relief values don't map onto platform-native border styles very well). At the very least, they should be NULL by default so that custom styles will work. ([ttk::label]s have the same problem wrt. custom styles. This will be fixed in 0.7 when we drop attempted BWidget compatibility.) For the "separator" style, it might work to define a Separator.TLabelframe.border element that only draws one edge of the border. Another groupbox style we ought to support is the BWidget PanelFrame, where the label appears in a shaded box that extends across the top of the frame. This isn't possible with the current layout algorithm, but it might work if the "-labelanchor" option were extended to allow things like "nwe" in addition to "n", "nw", and "ne". Then there's things like "disclosure boxes" (commonly used for e.g., "Show/Hide Advanced Options" sections in dialog boxes). I think this is currently doable as a snidget, using a custom [ttk::checkbox] as the -labelwidget. See also: #1117281, which may be tangentially relevant. And lastly: Under OSX, the groupbox background gets successively darker depending on the nesting level. Tile can't handle this at all right now (this is The Background Problem.) Other ideas? --Joe English jen...@fl... |