Articles 3D Audio Custom Controls General RB Graphics Hacks Mac OS X Menus Novelty Printing REALbasic 2005 REALbasic 2006 Registration Resources Reviews Serial Speech Sockets XML Video Resource Links News Current News February 2006 January 2006 December 2005 November 2005 October 2005 September 2005 August 2005 July 2005 June 2005 May 2005 April 2005 March 2005 ![]() REALbasic for Dummies by Erick Tejkowski ![]() Learning REALbasic through Applications REALbasic for Macintosh REALbasic Cross-Platform Application Development
Older files are in Stuffit 5 or greater format. Newer files are ".Zip". Download StuffIt Expander |
|
It's easier than ever to create background applications in Mac OS X. However, to convert a REALbasic-made application to a background application, you'll need to have a trick or two up your sleeve. This week we'll show you how to make a REALbasic application hide in the background. We'll also build a small tool to automate the process, so you don't have to think about this again. Backgrounding Background
Pretty simple, eh? When you build a Mac OS X application with REALbasic, however, there isn't one of these plist files to be found. All you have is an executable file. Look inside the resource fork with your favorite resource editor and you'll find the plist information in the 'plist' resource. Scroll to the end of that resource and locate this tidbit:
You could paste in the NSUIElement key listed above, but why bother. Not only do you have to poke around the resource fork and enter some text, you also have to edit the hex code of that character between the two lines in the previoes XML code to chr(13). That's too much of a pain for lazy programmers... especially when you want to debug a background application, where you might have to repeat this resource process dozens of times. To make life simple, let's create a tool to do the job for us. Build the Project me.acceptFileDrop "any" Then, in the DropObject event of Window1, add this code:
That's it! Build the application and run it. Now, whenever you drag a REALbasic-made OS X application into the window, it will instantly transform into a background application. When you create a background application, don't forget to give yourself a way to quit it, since the menubar won't be available. Conclusion |
||||
|
||||||||||||||||||||||||||||||||
Maintained by the Staff of ResExcellence. This entire site ©1997-2006 ResExcellence
Privacy Statement? Sure we gotta Privacy Statement.
[an error occurred while processing this directive]