[comp.sys.mac] New Mac Programmer -- HELP!

jmv@sppy00.UUCP (Jim Vickroy) (03/10/89)

I hope I'm not the only one who has felt the ultimate frustration in moving
MS-DOS to the Mac. So I'm going to try tapping this wealth of information:

Do anyone out there have a blow-by-blow procedure to:
1. Change the desktop icons from the defaults to custom icons?
2. Change the font of text in a window?

If these are really stupid questions please bare with me. I'm hacking around
with MiniEdit in LightSpeed C. I've modified the icons in the resource file
which is linked but no icons. I've also rebuilt my desktop but still no icons.

Thanks in advance

jim
--

!==================================================================!=========!
! Jim Vickroy                          | cbosgd!osu-cis!sppy00!jmv !/././././!
! Online Computer Library Center, Inc. |---------------------------!././././.!
! Dublin, Ohio  43017                  | jmv@sppy00                !/././././!
!------------------------------------------------------------------!././././.!
! "That voodoo stuff don't do nothin' for me"                 -jrr !/././././!
!==================================================================!=========!

jmv@sppy00.UUCP (Jim Vickroy) (03/10/89)

In article <64@sppy00.UUCP> jmv@sppy00.UUCP (Jim Vickroy) writes:
=>I hope I'm not the only one who has felt the ultimate frustration in moving
=>MS-DOS to the Mac. So I'm going to try tapping this wealth of information:
 
Sorry about that. If I we're able move MS-DOS to the Mac I wouldn't be asking
such basic questions. I'd probably want my head examined because who would
want to?! The statement should have read:

...in moving FROM MS-DOS to the Mac.

No flames please.

jim
--

!==================================================================!=========!
! Jim Vickroy                          | cbosgd!osu-cis!sppy00!jmv !/././././!
! Online Computer Library Center, Inc. |---------------------------!././././.!
! Dublin, Ohio  43017                  | jmv@sppy00                !/././././!
!------------------------------------------------------------------!././././.!
! "That voodoo stuff don't do nothin' for me"                 -jrr !/././././!
!==================================================================!=========!

wetter@cit-vax.Caltech.Edu (Pierce T. Wetter) (03/11/89)

> 1. Change the desktop icons from the defaults to custom icons?

    1. Decide what creator type your application will have. Applications have
    type APPL and creator '????'.
    2. Make a resource of whatever type. Lets call it 'THSS'. Put into this
     resource some sort of version information, like "This is my senior thesis"
     Remember that this is a pascal string, so the first byte is a length.
    3. Make a BNDL resource. Make references for and FREF and a ICN# resource.
       Call them local id 0 and local id 0 with actual id 128 and 128.
    4. Make the FREF and ICN# resources. The first FREF should reference type 
       APPL. Any others should reference data files. The ICN# resouce should
       be your desired icon.
    5. Set the 'bundle' flag on your application, and clear the 'Inited" flag.

  That's it. Here's some help for litte stuff. 
     To create a new resource of a specific type, open the file with resedit and
choose new. Then type in the type name (i.e. BNDL). This will make a 'slot
for resources of that type. Then open that type and select new again. This will
make a new resource of that type. Use get info on a selected resource to change
id numbers. In a BNDL resource, select the astrix and select new to add more
items to the BNDL. Do get info on a file to change the file flags.
 
 
> 2. Change the font of text in a window?
> 
	Call TextFont(fontnum) to change the current grafports font.
        Call SetDAFont(fontnum) to change the font that dialogs use.

Pierce

P.S. There dammit. Even if I don't know how many clock cycles the non-existant
multiply instruction on the 6502 takes to execute, I know how to add an icon to
an application.  
-- 
wetter@tybalt.caltech.edu or wetter@csvax.caltech.edu or pwetter@caltech.bitnet
   Rule to live by #32796: Act consistently in one persona until people have
characterized your reactions, then change personas.

drew@cat46.CS.WISC.EDU (Shawn Drew) (03/13/89)

In article <64@sppy00.UUCP> jmv@sppy00.UUCP (Jim Vickroy) writes:

[Another Mac convert is born!]
>
>Do anyone out there have a blow-by-blow procedure to:
>1. Change the desktop icons from the defaults to custom icons?
>2. Change the font of text in a window?

Assuming you have ResEdit, here are the steps you should take:

  1.  Open your resource file.
  2.  Choose New from the file menu.
  3.  Type in the 4-character application creator and press the OK button.
	The application creator is the 4-character abbreviation you told
	LSC to assign to the creator of your application.  Applications
	have a 4-character type ('APPL') and a 4-character creator ('SAMP'
	or 'JIMV' or whatever you want.)
  4.  Choose New again.
  5.  Close the resultant window and then choose Open As... from File.
  6.  Type STR_  (That's STR followed by a space) and press the OK button.
  7.  Type in some sort of version info (for the Finder's Get Info box).
	An example would be:  Test program v1.0 by Jim Vickroy
  8.  Close the window.
  9.  Choose Get Info in the File menu.
 10.  Change the ID number to 0.
 11.  Close the window.
 12.  Close the 'STR 's from xxxxx' window.
 13.  Choose New.
 14.  Type FREF, click OK.
 15.  Choose New.
 16.  Type AP in the File Type box
 17.  Type 0 in the Local ID box
 18.  Don't type anything in the other box.
 19.  Close the window.
 20.  Get Info.  Change ID to 130.
 21.  Repeat steps 15-20, substituting TEXT for APPL, 1 for 0, 131 for ID.
	TEXT above may be substituted for whatever type of file your program
	creates when it saves a document.
 22.  Close the 'FREFs for xxxxxx' window.
 23.  Choose New.
 24.  Type ICN#, click OK.
 25.  Choose New.
 26.  Create your application's icon.
 27.  Close the window.
 28.  Get Info
 29.  Change ID to 128.
 30.  Repeat steps 25-29, this time creating your document's icon, change the
	ID to 129.
 31.  Close the 'ICN#s from xxxx' window.
 32.  Choose New.
 33.  Type BNDL, click OK.
 34.  Choose New.
 35.  Type your application's creator in the OwnerName box, 0 in OwnerID.
 36.  Click on the row of asterisks and choose New twice.
 37.  Type ICN# in the first type box.
 38.  Click on the first row of hyphens and choose New twice.
 39.  For the first localID, type 0, for rscID, type 128.
 40.  For the second localID, type 1, for rscID, type 129.
 41.  Repeat steps 37-40, substituting FREF for ICN#, 2 for 0, 3 for 1,
	130 for 128, and 131 for 129.
 42.  Close the 'BNDL ID x from xxxxx' window.
 43.  Get Info.
 44.  Change ID to 132.
 45.  Quit ResEdit, saving changes.
 46.  Rebuild your application (in LSC).
 47.  Quit LSC.
 48.  If your icon is right, then end
else
 50.  Copy the application to a floppy disk.
 51.  Throw the floppy disk into the trashcan.
 52.  Hold down the Command and Option keys.
 53.  Reinsert the disk.
 54.  Click OK to rebuild the desktop.
 55.  If the icon is right, then end
else
 56.  Lift the Mac from your desk.
 57.  Throw it on the floor.
 58.  Go back to MS-DOS.

OK, the last three steps are optional    :^)

If you have any problems, just ask me.
>
>Thanks in advance
>
>jim

No trouble at all.


****** The opinions expressed in this article are my own ******
********** Except those who belong to other people  ***********
                    drew@cat46.cs.wisc.edu