Friday, July 16, 2010

Tip: Pushbutton Height and Backdrops on Mac OS X

With the Mac's market share approaching 10%, more Windows developers are wanting to cross-compile their projects to support Mac OS X. If you are coming from Windows, this tip will help you understand a few issues you may face and how to deal with them.

It may surprise you to find that there is a restriction on the height of a pushbutton on Mac OS X. If you make a button more than 22 pixels high, the button will change from being rounded to rectangular. This is not a feature of REAL Studio. It's a feature of Mac OS X:

Bonus Tip: If you add a background picture using the Window's BackDrop property, on Mac OS X your controls will have rectangles around them with a background that matches the window. As a result, they will look like this:

However, if you set the Window's Composite property to true, the rectangle will disappear:

You will continue to see the rectangle in the Window Editor on Mac OS X, but not in your running application. The rectangle in the Window Editor will likely disappear once we are compiling the IDE itself as a Cocoa application. Depending on the complexity of your window, you may or may not have some issues with using the Composite property as it has some problems on Carbon. However, these issues should disappear once you can build using the Cocoa option as all windows in Cocoa are composite and are handled quite well.

No comments: