Need Help With Visual Inconsistencies on wxMac

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Xangis
Earned some good credits
Earned some good credits
Posts: 122
Joined: Fri Apr 14, 2006 9:49 pm
Location: Beaverton, OR
Contact:

Need Help With Visual Inconsistencies on wxMac

Post by Xangis » Fri Oct 21, 2011 4:59 pm

I'm working on an app that needs to work with the built-in wx libraries on OSX 10.5 (wxWidgets 2.5).

The app looks great on Win32 and Linux, but needs some help on OSX.

There are a few things that look a little off:

1. I can set a button's width, but no matter what I set the height to, it seems to take the MacOS "default button height".
2. I can't get a text label to be transparent. If I draw a text control manually in a paint event like I do on Linux (via dc.DrawText()), it still erases the background before drawing. Is there a way to draw text transparently (as in, without erasing the background)?
3. With a wxTextCtrl, it doesn't honor the background color setting. The UI design calls for light text on a dark background, but the best I can get is light text on the window default background color.
4. The font size on text doesn't seem to be very accurate. Text is significantly smaller than on Win32 or Linux for the same requested font size.

Are there any standard workarounds for the things that don't look the same in wxWidgets on OSX? Any suggestions for getting the behavior I'm going for?
WinVista/7: VC++ .Net 2010 / Ubuntu 11.04: gcc4.4.3 [2.8.12 on all]

Xangis
Earned some good credits
Earned some good credits
Posts: 122
Joined: Fri Apr 14, 2006 9:49 pm
Location: Beaverton, OR
Contact:

Re: Need Help With Visual Inconsistencies on wxMac

Post by Xangis » Fri Oct 21, 2011 9:27 pm

Here's another:

5. When I set foreground and background color on a button, the button and its text does not change color. Only the corners in the "rounding area" change color.
WinVista/7: VC++ .Net 2010 / Ubuntu 11.04: gcc4.4.3 [2.8.12 on all]

Xangis
Earned some good credits
Earned some good credits
Posts: 122
Joined: Fri Apr 14, 2006 9:49 pm
Location: Beaverton, OR
Contact:

Re: Need Help With Visual Inconsistencies on wxMac

Post by Xangis » Sat Oct 22, 2011 1:06 am

To get buttons how I want I had to create a wxBitmapButton.

http://forums.wxwidgets.org/viewtopic.p ... ht#p102403
WinVista/7: VC++ .Net 2010 / Ubuntu 11.04: gcc4.4.3 [2.8.12 on all]

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Re: Need Help With Visual Inconsistencies on wxMac

Post by Auria » Sat Oct 22, 2011 2:00 am

I would very strongly recommend to NOT rely on the wx 2.5 that comes with OSX 10.5. 2.5 is just very outdated and you won't get any support for it.

It's usually very easy to just build wxWidgets statically so that it gets included inside your application, so it's transparent to the end-user
"Keyboard not detected. Press F1 to continue"
-- Windows

cozmotion
Earned a small fee
Earned a small fee
Posts: 14
Joined: Thu Oct 22, 2009 10:37 pm

Re: Need Help With Visual Inconsistencies on wxMac

Post by cozmotion » Thu Aug 30, 2012 6:34 pm

Did you ever find a workaround for the difference in the way Windows and OSX interpret font sizes? I am seeing the same annoyance.

Xangis
Earned some good credits
Earned some good credits
Posts: 122
Joined: Fri Apr 14, 2006 9:49 pm
Location: Beaverton, OR
Contact:

Re: Need Help With Visual Inconsistencies on wxMac

Post by Xangis » Thu Aug 30, 2012 10:28 pm

I just ended up using ifdefs combined with building newer wx (that fixed some problems, but not font sizes). Not pretty but it worked.

For example,

Code: Select all

#ifdef __WXMAC__
int fontSize = 16;
#else
int fontSize = 14;
#endif
Then I created controls using that variable, used fontSize+4 for title text, fontSize-2 for subscript, etc.
WinVista/7: VC++ .Net 2010 / Ubuntu 11.04: gcc4.4.3 [2.8.12 on all]

Post Reply