[comp.sys.mac.programmer] INIT's and ICON's...

sonenbli@oxy.edu (Andrew D. Sonenblick) (10/07/89)

     Is there a standard way for INIT's to know where to place their
  startup Icon?  Does INIT 31 do any for them, or do they have to
  determine on their own (blugfertleness, if you know what I mean)
  where to put them.  You know, this is one of those questions that
  you never even think of until, wham, suddenly it becomes relevant to
  you...  Thanks.   Ando Sonenblick:  sonenlbi@oxy.edu

kingman@tci.bell-atl.com (Matt Kingman) (10/10/89)

sonenbli@oxy.edu (Andrew D. Sonenblick) writes:


>     Is there a standard way for INIT's to know where to place their
>  startup Icon?

Use "ShowINIT" by Paul Mercer (This can be had from Mac DTS).  Just link it
with your program and call it when your INIT starts up.  ShowINIT figures
out where to put the icon.

/Matt
-- 
Matt Kingman  Technology Concepts Inc.  Sudbury, MA.  (508)443-7311
      ...!uunet!tci!kingman         kingman@tci.bell-atl.com
     TCI is not responsible for my opinions, nor I for theirs...

thecloud@dhw68k.cts.com (Ken McLeod) (10/10/89)

In article <52468@tiger.oxy.edu> sonenbli@oxy.edu (Andrew D. Sonenblick) writes:
>
>     Is there a standard way for INIT's to know where to place their
>  startup Icon?  Does INIT 31 do any for them, or do they have to
>  determine on their own (blugfertleness, if you know what I mean)
>  where to put them.  You know, this is one of those questions that
>  you never even think of until, wham, suddenly it becomes relevant to
>  you...  Thanks.   Ando Sonenblick:  sonenlbi@oxy.edu

  Yes, there is a standard way for INITs to display a startup icon. It's
called 'ShowINIT', and the code to do it automagically was placed into the
public domain by its author (Paul Mercer). Basically, the scheme involves
storing the current horizontal drawing position and a checksum value in a
portion of low memory that isn't used during startup. As each INIT loads,
if the programmer is using ShowINIT, the icon is drawn at the correct
position... then the new position is calculated and stored for the next
INIT to use. Since startup icons have become "standard behavior" for INITs,
you risk confusing (or annoying) the user if you use your own scheme for
icon display, and clobber someone else's icon. It's also a good idea to
provide some way to let the user control whether the icon will be displayed
at all (some people actually dislike the startup parade! :-)

  I'll be posting my CShowINIT package to comp.binaries.mac, including
a standalone 'INIT' resource which can be pasted into existing INIT files
to automatically display either a 'cicn' or 'ICN#'; the source to IconWrap
1.2 (a utility to allow multiple rows of startup icons), and of course,
the ShowINIT source (in LightspeedC, some inline assembly). Apologies
to several people who've mailed requests for ShowINIT to me previously;
my attempts to reply kept bouncing! :-(
 
-- 
==========     .......     =============================================
Ken McLeod    :.     .:    UUCP: ...{spsd,zardoz,felix}!dhw68k!thecloud
==========   :::.. ..:::   INTERNET: thecloud@dhw68k.cts.com
                ////       =============================================