Sizers not working correctly on OSX Mojave

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Sizers not working correctly on OSX Mojave

Mike Driscoll
Hi,

I was playing around with the attached code and noticed that it doesn't work correctly on Mac OSX Mojave. The button should be stretched out in both directions and take up most of the frame's space. Instead, it just stretches in one direction. On Windows and Linux, this code works as expected. I am using wxPython 4.0.3 with Python 3.6 on all 3 platforms.

I noticed the sizer also does some screwy things on my Mac if I add another widget to it too. The widgets are not next to each other as I would expect. It is as if the border is getting stretched or expanded rather then the widget itself.

Thanks,
Mike

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

simple_sizer_expand.py (687 bytes) Download Attachment
sizer_with_proportion.png (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Sizers not working correctly on OSX Mojave

Robin Dunn

On Tuesday, November 13, 2018 at 9:44:30 AM UTC-8, Mike Driscoll wrote:
Hi,

I was playing around with the attached code and noticed that it doesn't work correctly on Mac OSX Mojave. The button should be stretched out in both directions and take up most of the frame's space. Instead, it just stretches in one direction. On Windows and Linux, this code works as expected. I am using wxPython 4.0.3 with Python 3.6 on all 3 platforms.

I noticed the sizer also does some screwy things on my Mac if I add another widget to it too. The widgets are not next to each other as I would expect. It is as if the border is getting stretched or expanded rather then the widget itself.


Yep. This is normal for the native button widget on macOS. The wxButton is actually the expected size, as can be seen in the widget inspector tool, but the native widget will only draw itself at the standard heights and won't draw anything in the remaining space. If you need a taller than standard button, then you can add a bitmap, use a generic button from wx.lib.buttons, or etc.

--
Robin

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Sizers not working correctly on OSX Mojave

Mike Driscoll-2
Hi Robin,

On Tue, Nov 13, 2018 at 1:42 PM Robin Dunn <[hidden email]> wrote:

On Tuesday, November 13, 2018 at 9:44:30 AM UTC-8, Mike Driscoll wrote:
Hi,

I was playing around with the attached code and noticed that it doesn't work correctly on Mac OSX Mojave. The button should be stretched out in both directions and take up most of the frame's space. Instead, it just stretches in one direction. On Windows and Linux, this code works as expected. I am using wxPython 4.0.3 with Python 3.6 on all 3 platforms.

I noticed the sizer also does some screwy things on my Mac if I add another widget to it too. The widgets are not next to each other as I would expect. It is as if the border is getting stretched or expanded rather then the widget itself.


Yep. This is normal for the native button widget on macOS. The wxButton is actually the expected size, as can be seen in the widget inspector tool, but the native widget will only draw itself at the standard heights and won't draw anything in the remaining space. If you need a taller than standard button, then you can add a bitmap, use a generic button from wx.lib.buttons, or etc.

--
Robin

That's really interesting. I haven't played around with my sizer examples in Mac OSX enough then. 

Thanks for letting me know. 

Mike 

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.