[net.micro.mac] Accessing patterns?

maclab@reed.UUCP (Mac DLab) (01/20/86)

> 
> I'm trying to get patterns from the standard system pattern list (not the 5
> fill shades, but the 38 ones used in MacPaint) in a Megamax C program.
> There is a nice function to do this in Pascal called 'GetIndPattern' but it
> doesn't seem to exist in C.  These patterns are in a list in the system
> resource file of type 'PAT#' - does anyone know how to access them
> individually?  Any suggestions would be appreciated!
> 
> Thanks - Alex Rehak
>  {allegra,ihnp4,princeton,astrovax}!siemens!rehak
>  or call
> (609)734-6555


  Here is source for the Rascal 'GetIndPattern' -- 

------------------------------------

PROCEDURE GetIndPattern( thePat: ^Pattern; patListID: INTEGER;
                       index: INTEGER);
Type
  PatList = Record
    Num: Integer;
    Pats: Pattern[1];  (* actually,  a variable length array *)
  End;
  PatLHand = ^^PatList;
Var
  Hand: PatLHand;
{
  Hand := GetResource(ptrL(" PAT#"+2)^,patListID);
  If (!Hand) or (index > Hand^^.Num) or (index=<0) then return;
  thePat^ := Hand^^.Pats[--index];
};

------------------------------------


Scott Gillespie