May 18, 2008
Its been awhile and I’m back into Flex after treading the SWT / OS X waters. Getting from idea to code to working application is definitely a faster cycle with Flex, although if you have requirements for a native looking desktop app, well, AIR isn’t quite there *yet*.
However - for next-gen hybrid apps, the desktop look and feel (LAF) requirement seems to be less and less important. A good example is comparing Twitterific (native?) and Pownce (AIR). Both function very much alike and even have a similar LAF. Outside of the debate of Twitter vs. Pownce, the installation and usability experience for the two is comparable.
Perhaps we can thank the Web 2.0 generation for creating acceptance of a ‘meta’ LAF consisting of bubbly shiny glass, which really owes its inspiration to OS X anyway.
So what’s my point? Nothing other than to announce my coding focus is back on Flex. I’ve had some ground to cover to catch up - most notably Blaze DS and Papervision 3D. More posts on Flex coming…
No Comments » |
Technology | Tagged: Flex AIR |
Permalink
Posted by Mitch Coopet
May 6, 2008
Yes its alpha and yes its a hard name to pronounce but it solved a lingering SWT / AWT bridge issue I was facing on OS X Leopard.
Specifically, I had an issue with native dialogs such as DirectoryDialog and FileDialog on Leopard. When these would pop up, they would fight for focus with the application window, resulting in flickering and non-functional controls.
I’m happy to say that Albireo made problem go away!
http://www.eclipse.org/albireo/
No Comments » |
Java, Mac, eclipse |
Permalink
Posted by Mitch Coopet
May 6, 2008
Lets say you want to create a nice installer for your OS X application that looks something like this -
Lets also say you want to it completely automated so you can do it with a simple one line command OR make it part of an integration build process.
Using XCode’s PackageMaker tool and ant, its pretty simple to create a build.xml that automatically creates a package for you. In fact, its even easier for you because I’ve already created a sample project that does this!
Requirements
You will need the following tools
This article assumes you have are familiar with Apache ant.
Quick Start
Download the AntPackageMaker sample project -
- Open a teminal
- cd into its directory
- Type ‘ant’
This will create a package installer for the world famous TextEdit application in the directory ‘pkg’. You can open this directory in Finder and double click ‘TextEdit.pkg’ to see the results! Move on to the next section for customizing AntPackageMaker for your own project.
AntPackageMaker Project Overview
This sample project contains a template package to use for creating a customized package, a sample application (TextEdit.app) and ant files necesary to create the package.
Files and Directories
- build.xml - The ant build file
- bundle/ - Put your application bundle here - i.e. MyApp.app. Don’t forget to remove TextEdit.app!
- pkg-src/ - The package template files
- pkg.properties - The ant properties files for building the package
Customizing
Here’s what you need to do to customize this project for own app.
- Copy your application into the ‘bundle’ directory. Make sure you remove TextEdit.app
- Customize the files License.rtf and Welcome.rtf in the ‘pkg-src’ directory.
- Change the background.gif image in the ‘pkg-src’ directory and, yes, it has to be a GIF.
TIP - Make sure you save it with transparency and set the transparency matte to #EEEEE
- Open pkg.properties in a text editor and change the values as necessary. You could even use TextEdit - just make sure to keep the formatting pain text!
Here’s a look at pkg.properties - all you need to change is ‘pkg.name’ to the name of your application.
## Package Properties
# Application name - here we're bundling TextEdit
pkg.name=TextEdit
# Location for the application bundle, i.e. TextEdit
# This sample project has TextEdit in the local 'bundle' directory
pkg.bundle=${basedir}/bundle
# Directory where the package template lives
pkg.src.dir=${basedir}/pkg-src
# Directory where we will create the package
pkg.dir=${basedir}/pkg
# The actual package
pkg=${pkg.dir}/${pkg.name}.pkg
# The package Info.plist - gets autogenerated
pkg.info=${pkg.src.dir}/Info.plist
# The package Info.plist template to use
pkg.info.template=${pkg.info}.template
# The package Description.plist - gets autogenerated
pkg.description=${pkg.src.dir}/Description.plist
# The package Description.plist template to use
pkg.description.template=${pkg.info}.template
Usage
Feel free to use this however you wish! If it helps you out, I’d love to hear about it.
No Comments » |
Java, Mac, Technology |
Permalink
Posted by Mitch Coopet
May 3, 2008
If you’ve been stumped on how to cover that ‘last mile’ with making your SWT application look completely native on OS X, take a peek at the open source project Azureus. In my case, I had 2 issues left to figure out -
- Capture and handle dock icon click events
- Add additional menu items to the application menu
Follow the link below and look at the class ‘CarbonUIEnhancer’. This class demonstrates how to hook into OS X’s application menu and handle AppleScript events.
Browse Azureus swt.osx source package
No Comments » |
Java, Mac | Tagged: Java, OS-X, SWT |
Permalink
Posted by Mitch Coopet