Article Preview
Buy Now
| PDF: |
Review
Carbon Declare Library
Issue: 1.2 (October/November 2002)
Author: Greg Fiumara
Article Description: No description available.
Article Length (in bytes): 4,054
Starting Page Number: 8
RBD Number: 1103
Resource File(s): None
Related Link(s): None
Known Limitations: None
Full text of article...
With the release of Mac OS X.1 and the Cocoa programming language, many REALbasic programmers have found that the user interfaces of their applications don't quite cut it anymore. With the introduction of OS X, the Cocoa API (accessed by programs developed with Project Builder from Apple) has upped the ante for interface design on the Mac. Cocoa developers get all of the Aqua interface goodies, from anti-aliased text to window menus, for free. You don't have to learn a whole new programming language though, you just have to write all of the Carbon Declares (calls to the Macintosh Toolbox) yourself. Challenging, yes, unless it is already done for you, as it is with Carbon Declare Library (CDL).
CDL is available for free download as a module you simply drag-and-drop into the REALbasic project window. The set of functions in this module is almost too good to be true. For example, with just one line of code calling the function createWindowMenu, you can create a window menu (showing all open windows, zoom window, etc.) that even automatically updates with every opened and closed window, without any extra code. Intimidated by Cocoa applications' error dialogs? With CDL, just specify all the information that you want in the dialog, such as the number of buttons, the error message, or the icon, and you're done; again with one line of code. If that isn't enough, you can create sheet dialogs and even make them transparent. Ever pressed the resize button in a Cocoa application and watched the window resize smoothly? With CDL, type in the size you wish to resize the window to and you get the same effect in REALbasic.
The inspiration behind this library of code was to keep people from having to ask the same questions over and over again on the REALbasic e-mail lists. The original set of code, first compiled by Jarvis Badgley in November 2001, contained only 7 functions. With the help of many questions asked to the lists and many hard working developers armed with a copy of TBFinder and Apple's Universal Headers, code snippets were being sent left and right for inclusion into this library. At press time, the latest release of CDL (June 28, 2002), had well over 100 functions, and continues to grow daily.
There is a single downside to this library: there is no documentation included. Sure, some of the code is commented, but much is not and much of the commented code is hard for first-time programmers to comprehend. The current curator of the library, Kevin Ballard, wrote in the latest release that he is "trying to document each method."
Sure, you could have written all of the declares yourself, spending hours playing around with C code. And sure, you could have spent money buying various plugins to achieve the same effect or you could have even learned Cocoa, but wouldn't that just be a waste of your time and money? Why not choose the collaborative open-source project and stick with REALbasic?
In Brief Product Carbon Declare Library Manufacturer This Might Be Software Price Free System Requirements N/A Contact Info kevin-at-sb.org
http://www.tildesoft.com/Code.html
Pros Free; Saves time and money; Helps RB applications look more like Cocoa applications Cons Only documentation is commented code; Some methods have no documentation Rating (1.0-5.0): 4.8
End of article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|











