Path: utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!csd4.csd.uwm.edu!mailrus!ncar!boulder!tramp!hartkopf From: hartkopf@tramp.Colorado.EDU (Jeff Hartkopf) Newsgroups: comp.sys.apple Subject: programming questions Message-ID: <11032@boulder.Colorado.EDU> Date: 25 Aug 89 05:59:45 GMT Sender: news@boulder.Colorado.EDU Reply-To: hartkopf@tramp.Colorado.EDU (Jeff Hartkopf) Organization: University of Colorado, Boulder Lines: 69 I have two questions concerning toolbox programming on the GS, using ORCA/C. I have previously accomplished what I'm asking about below when I was using TML Pascal, but I can't figure out how to do it in C. 1) How do you create a set of 16 colors for 640 mode, like the pre-defined StdColors[] in TML Pascal? The Pascal manual says that they defined StdColors like StdColors: array[0..15] of Pattern; and that StdColors[0] (black) contains 16 words of $0000, StdColors[1] (blue) contains 16 words of $1111, ..., StdColors[15] (white) contains 16 words of $FFFF. Now, how would I actually declare/initialize an array like this in ORCA/C, so that I could use the statement SetPenPat(color[x]); 2) How do I define an icon (in the format used for DrawIcon()) in C? In Pascal, I did it like this (there are bound to be errors in the following code, I just show it as a comparison): type masktype = array[1..height, 1..widthbytes] of byte; iconrec = record IconType: Integer; IconSize: Integer; IconHeight: Integer; IconWidth: Integer; IconImage: masktype; IconMask: masktype; end; var iconmask: masktype; icon: iconrec; with icon do begin IconType := ColorIconType; IconSize := size; IconHeight := height; IconWidth := width; end; procedure makeicon; StuffHex(@icon.IconMask[1], 'FFFFFFFFFFFFFF'); StuffHex(@icon.IconMask[2], 'FFFFFFFFFFFFFF'); { ... } StuffHex(@icon.IconImage[1], 'F000FFFC000000'); StuffHex(@icon.IconImage[2], 'C0003FF0000000'); { ... } end; and then draw the icon with DrawIcon(&icon, 0, 0, 0); Thanks very much for any help. Jeff Hartkopf Internet: hartkopf@tramp.Colorado.EDU