[comp.sys.mac.programmer] Help! How to finish an LSC application: bundles, etc.

kevin@kosman.UUCP (Kevin O'Gorman) (05/02/88)

Well, even without a working debugger (TMON crashes on my MacII also;
see separate article), I have a finished (well, almost) application.

The problem is it has the default icon, no bundle, and no application
creator, and no file icon.

I'm having quite a fight with ResEdit just getting a pict into my
"About..." dialog.  I can't seem to edit resource ID's, even when I'm
creating one new -- there doesn't seem to be a hook for this.  How am
I gonna create a bundle, which needs several specific resource ID's?

How am I gonna set the creator?  Is there more?

Do I have to write my own application just for this little chore?  That
wouldn't be too hard, probably, but it's annoying, and not really what I
want to do with my time.


Kevin O'Gorman ( kevin@kosman ) voice: 805-984-8042
  Vital Computer Systems, 5115 Beachcomber, Oxnard, CA  93035

dorourke@polyslo.UUCP (David M. O'Rourke) (05/05/88)

In article <391@kosman.UUCP> kevin@kosman.UUCP (Kevin O'Gorman) writes:
>I'm having quite a fight with ResEdit just getting a pict into my
>"About..." dialog.  I can't seem to edit resource ID's, even when I'm
>creating one new -- there doesn't seem to be a hook for this.  How am
>I gonna create a bundle, which needs several specific resource ID's?

   Use the get info command before "opening" the resource of your choice.
If you highlight the resource in the list, and then choose get info from
the file menu that will allow you to change the resource ID.  This is
also how you can change the creator and type of a file.  If you highlight
a file in the list and choose get info it will allow you to edit the file
header which contains the creator and type.


David M. O'Rourke

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| dorourke@polyslo | Disclaimer:  All opinions in this message are mine, but  |
|                  |              if you like them they can be yours too.     |
|                  |              Besides I'm just a student so what do I     |
|                  |              know!                                       |
|-----------------------------------------------------------------------------|
|    When you have to place a disclaimer in your mail you know it's a sign    |
| that there are TOO many Lawyer's.                                           |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

gixb@leela.cs.orst.edu (Brian Gerard Gix) (05/07/88)

To get and change resource IDs,  I've always just selected the resource under
ResEdit, did a "Get Info..." under the FILE menu, and changed everything from
there.  You can also change the file type and creator by using the Get Info
on a selected file and if you are creating a bundle for it, you can also
select that under the same dialog.

			--Brian
			"Not the Gospel: just my opinion"

minow@thundr.dec.com (Martin Minow THUNDR::MINOW ML3-5/U26 223-9922) (05/10/88)

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.
*