![]() 3D 3D Photo Gallery (Part 1) 3D Photo Gallery (Part 2) Audio Poor Man's MIDI Make A Metronome iPod Tricks (Part 1) iPod Tricks (Part 2) iPod Tricks (Part 3) Laugh Track Machine Audio Player with Reverb Shepard Melody RB Phone Home Build a Drum Machine Custom Controls and Windows Double Click Listbox Draggable Metal Window Double Click Canvas Custom Buttons Custom Buttons Part II iTunes-style Listboxes Custom Controls General RB Scrolling Windows Using Mesage Dialogs Case-Sensitive Word Finder Introduction to Stacks Wiggle Window JPEG in PDF Listbox Checkboxes Background Applications Listbox Auto-Find Virtual Volumes Time Tracker Software Distribution (Part 1) Software Distribution (Part 2) Software Distribution (Part 3) Software Distribution (Part 4) Exceptions Tips and Tricks Text Clippings Made Easy Graphics Drawing a Simple Gradient The SpriteSurface: Space Game Image Spinner Cropping Graphics (Part 1) Cropping Graphics (Part 2) Cropping Graphics (Part 3) Cropping Graphics (Part 4) Shimmer Graphics Lissajous Figures Simple Screen Capture Vector Graphics Kaleidoscope Images Stegonography Spirals! Image Table RB Magnifying Lens Screen Capture Color Picker Tutorial Hacks Ghost Grab Speedy Mouse Extension iTunes Plugins iTunes Skinner Mac OS X Global Hot Key Event (Carbon Events) Login Welcomer (Carbon Events) Add/Remove Buttons Resizable Sheets Mac OS X Preferences Window Using Sheets in REALbasic Build a Bundle (Part 1) Build a Bundle (Part 2) Dock Your Passwords Mac OS X Debugging REALbasic Mac OS X Icon Tutorial Animate Your Dock RB and the Command Line Menus Window Menu Templates Menu Listbox Menu Novelty Guessing Game Calendar Trivia Tile Mixer Zip Code Finder Happy Valentine's Day Merlin Simulator (Part 1) Merlin Simulator (Part 2) Merlin Simulator (Part 3) Buzzword Machine AppleSoft BASIC Printing Print to PDF Registration Registration Code Validation Network Registration Codes Resources Picture Extractor (Part 1) Picture Extractor (Part 2) Serial Caller ID (Part 1) Caller ID (Part 2) Caller ID (Part 3) Speech Speech Recognition Socket Communication Easy Peer-to-Peer File Sharing MacPAD Version Checking Display Web Image In Canvas HTML IMG Tags Version Tracking Even Smarter Instant Messaging Web Tiler JavaScript and REALbasic Stock Ticker (Part I) Stock Ticker (Part 2) AIM Mate XML Manipulation Simple XML Introduction Video Big Brother Video Capture Note: All articles without a byline were written by Erick Tejkowski. When cleaning the site I removed them because the code differed from page to page, and I have yet to put them back in.
Tell us about a bad link. |
The Mac OS has had the ability to display 32 bit icons for a few years now and they look beautiful compared to their lesser-colored cousins, the 8 bit icons. Mac OS X extends this beauty by also displaying large icons. But, how does one incorporate them into a Mac OS X application made with REALbasic? This week we'll show you how! Create the Icons The first step on your journey to 32 bit icon bliss is to..... create icons. There are a number tools out there that will help you design and build 32 bit icons, but my favorite is Iconographer. Iconographer lets you create and preview your icon masterpiece as you work on it, showing the various icon sizes and masks along the way. Mac OS X supports icons up to sizes of 128x128. Iconographer can handle these as well.
Then, when you're finished with the artwork, Iconographer will permit you to save the result as an icon resource file. It is this resource that we need for inclusion into our REALbasic project. Select "Mac OS Universal" in the Save Dialog when you save the icon.
Break Out the Resource Editor Now that you have built your icon resource file, open it using a resource editor. ResEdit will work fine for this. Select the 'icns' resource within and copy it to the clipboard. Choose File->New and create a new resource file. Give it a name like "Resources" and paste the 'icns' resource from the clipboard into this new file. With the resource selected in the new file, press Cmd-I and change the resource number to 128.
Break Out the Resource Editor Now that you have built your icon resource file, open it using a resource editor. ResEdit will work fine for this. Select the 'icns' resource within and copy it to the clipboard. Choose File->New and create a new resource file. Give it a name like "Resources" and paste the 'icns' resource from the clipboard into this new file. With the resource selected in the new file, press Cmd-I and change the resource number to 128. If this is the only icon you need for your application, you're finished! Save the resource file and drag it into your REALbasic application. When you build for Carbon, your icon will appear in all its 32 bit and 128x128 glory in Mac OS X. Document Icons Your application may have other icon needs besides the application icon. For example, if your application will create documents, you may want the resulting documents to display a 32 bit icon. The process works similarly for document icons. Create the icon, save it, and open it an a resource editor. To your "Resources" file, add the new icons, incrementing the resource number as you go. Since the application has a resource number of 128, the first document icon will have a resource number of 129; the second document icon would be 130, and so on. There is one "gotcha" when dealing with document icons, however. Consider this scenario. Suppose your application will create TEXT and HTML documents and will also open (but not create) JPEG graphic files. Since TEXT and HTML files are the only documents that your application will create, these are the only icons you must produce. As you assign the resource numbers, you must strictly follow the order that they appear in the "File Types" dialog, skipping over any file types that will not need icons.
So, for this example, the icon for TEXT would have a resource number of 129 and the HTML document would have a resource number of 130. Conclusion You may download the application icon if you'd like to see how the resources should look when you are finished. See you next week! |
|||||
|
Please support ResExcellence by Visiting our Sponsors. One click makes a difference. |
||||||
|
|