Difference between revisions of "Development: wxMac"

From WxWiki
Jump to navigation Jump to search
Line 35: Line 35:
  
 
Create a wxMenu and put your items into it. Then append that to the menu bar naming it "Help", or using the static member variable wxApp::s_macHelpMenuTitleName. Those items will automagically go to the OS supplied Help menu.
 
Create a wxMenu and put your items into it. Then append that to the menu bar naming it "Help", or using the static member variable wxApp::s_macHelpMenuTitleName. Those items will automagically go to the OS supplied Help menu.
 +
 +
=== Common Pitfalls ===

Revision as of 06:22, 18 August 2008

wxOSX, wxMac, wxCocoa, Carbon and Cocoa

Status

At WWDC 2007 Apple stated that all new GUI features will only be available from the Cocoa API, this was in line with our roadmap for wxMac which was published here earlier. The current implementation of wxMac in the 2.8 branch is based on the Carbon API while in trunk wxMac has broadened and was renamed wxOSX.

wxOSX née wxMac

all common OS X code is using the core frameworks available, so eg the wx drawing API is using CoreGraphics everywherer, the GUI source part has three flavours named after the APIs used, there is a wxOSX_CARBON which is mainly the complete and proven code base with slight updates, a wxOSX_COCOA which is using Cocoa obviously and were we will be pulling in source from the wxCocoa port, and last but not least wxOSX_IPHONE which is using the Cocoa Touch API that exists only on the iPhone and the iPod touch.

Next Steps

Replace HIToolbox

wxOSX is using a pImpl based implementation so that common code can be used wherever possible. While the Carbon flavour in trunk obviously has been tested extensively and is the most complete implementation, we can now add the native Cocoa and Cocoa Touch native elements, so that users can always test their applications against trunk and different implementations and switch back to Carbon if they stumble accross a not yet implemented or not yet functional area.

iPhone Interface Integration

The iPhone has a very distinct interface, so creating the core GUI of an application running on iPhone should be done using the native Interface Builder Tools from Apple. But the processing, faceless part (or simple GUI parts like message boxes etc) can be done using wx. We should offer a neat integration for a GUI designed Interface Builder into wx, much like there is the bridge for native .RC integration on MS-Windows.

Think different...

Many things on OS X are very familiar, and yet some are very different. Having your app running on Mac without paying attention to certain details will always make it look 'foreign', i.e. a 'ported app' something Mac users are very critical of, while following the Mac way of doing things will help you make it a success.

Learning Macintosh Programming

Since so few people know so little about this: Development: Mac Programming.

Getting You App to Run

Putting Menu Items in the Help Menu

Create a wxMenu and put your items into it. Then append that to the menu bar naming it "Help", or using the static member variable wxApp::s_macHelpMenuTitleName. Those items will automagically go to the OS supplied Help menu.

Common Pitfalls