Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!thundr.dec.com!minow From: minow@thundr.dec.com (Martin Minow THUNDR::MINOW ML3-5/U26 223-9922) Newsgroups: comp.sys.mac.programmer Subject: re: Help! How to finish an LSC application: bundles, etc. Message-ID: <8805100439.AA24032@decwrl.dec.com> Date: 10 May 88 07:38:00 GMT Organization: Digital Equipment Corporation Lines: 93 A recent posting asked how to finish an LS-C application by adding the resources needed to put a neat icon on the screen. This seems to work for me -- but I'm a rank beginner, so don't assume you won't find any errors. Good luck. Martin Minow minow%thundr.dec@decwrl.dec.com decwrl!dec-rhea!dec-thundr!minow * * This is a skeleton resource file for Lightspeed C that illustrates * the steps you have to take to add an icon to an LS-C application. * In the following, assuming you are building a program named Sample. * The first two non-comment lines identify the Rmaker output file, * file type and signature: * Sample Project.rsrc APPLFUBR ;; APPL, followed by your "signature" * * Be sure to click on the "Set Project Type" menu and set the project * to "Application" and the creator to "FUBR" -- it would be wise to * choose a creator name that doesn't conflict with defined resources. * * Next, create a version number resource. You can get this resource * within your program to log patches. Note that the resource is * defined as "type FUBR = STR " -- there is a mandatory space after * the 'R' of STR. * type FUBR = STR ,0 Sample resource version 0.0 3-May-1988 * * This is a resource that tells Multifinder your partition size. * (I think -- I haven't found it described anywhere.) * type SIZE=GNRL ;; for MultiFinder ,-1 .h 40 00 00018000 00010000 * * Your icon goes here. There are several PD and/or shareware programs * you can use to construct it. * You actually need two icons -- the thing itself and a mask. * You will have to supply the 64 longwords needed to describe the icon. * Type ICN# = GNRL ;; The program's icon and mask ,128 .H Your stuff goes here. * * The FREF resource defines the file type * type FREF ;; The file reference -- points back to APPL 0 ,128 APPL 0 * * Finally, a BNDL resource collects the FREF, signature, and icon list. * type BNDL ;; The file bundle ,128 FUBR 0 ;; Your signature, again. ICN# ;; The icon 0 128 FREF ;; and file reference. 0 128 * * Add the resources your program needs -- dialogs and fonts and whatever * -- and run the file through Rmaker to get a resource file. * when you build the application, you should get the proper icon. * (Also, the compiled resource file should show the icon.) * * If you change the icon, you will probably have to rebuild the desktop, * as the Mac caches application icons so, seeing the same file, it doesn't * bother to import the actual icon. You might want to use ResEdit to * check the application file -- make sure that the Bundle and Inited * boxes are checked, and that the Type and Creator fields are correct. * * Good luck. *