[wxPython-users] Size of controls on wxMac

Christopher Barker Chris.Barker at noaa.gov
Fri Feb 23 15:26:52 PST 2007


Stephen Hansen wrote:
>     Is there a flag or something I can use to tell wxMac to use the smaller
>     version of a given Window/control? 

> I don't think its possible unless you roll your own checkbox that you 
> are drawing yourself. wx nicely wraps native widgets when possible, and 
> I don't think the Apple controls are going to shrink gracefully; it goes 
> against their HID.

All true, but I have a memory that there are "small" versions of at 
least some of the controls, and there is a way to tell wx to use them -- 
I just can't remember how!

> the mac controls have extra shadows and stuff and 
> in the end just need a bit more room to look right on the mac platform. 

Exactly. I'd just be happier if that was built in to wx -- that Mac 
buttons reported a size that reflected extra shadows and stuff. It's 
also odd that the CheckBoxes, for instance, seem to give themselves a 
lot of space, but the button don't.

>    button.SetSizerProps(border=self.__Border[platform])

>    self.sizer.Add(button, wx.ALIGN_LEFT | self.__BorderOrient[platform], 
> self.__Border[platform])

> attribute on the parent there as you can see. When not appropriate, 
> button.SetSizerProps(border={"darwin": ("all",7), 
> "win32":("all":5)}[platform]) isn't so difficult or ugly either.

Both good suggestions.

I now Kevin O. had some good ideas about how to build more of this in to 
the Windows or Sizers themselves. The idea was that you could easily 
automagically build HIG compliant layouts. I wonder what came of that?

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list