hartkopf@tramp.Colorado.EDU (HARTKOPF JEFFREY M) (06/13/89)
To Dave Lyons: For some reason I couldn't get this letter to you through E-mail like I was able to with my first one, so I'll post it... Dave, Sorry to bother you again but I'm stuck once more trying to draw icons in windows with DrawIcon. I guess my problem isn't that I'm not doing the DrawIcon parameters right, but that my icon format must be wrong. I figured out how to draw an icon in a dialog box using NewDItem, where the format for the icon was MyIcon: record BoundsRect: Rect; Data: Array[1..11, 1..7] of byte; end; (remember I'm using TML Pascal). Then I used the StuffHex procedure like StuffHex(@MyIcon.Data[1], 'abcdef12345678'); StuffHex(@MyIcon.Data[2], '00030030400201'); ... StuffHex(@MyIcon.Data[11],'10357182748274'); or whatever (this for the Dialog box version). Now in your letter to me you said I should do it using an array of char like array[0..200] of char, and then using StuffHex like StuffHex(@MyIcon[0], '1029492412a2'); StuffHex(@MyIcon[6], '........ and so on. Is this the method for IconItem's or DrawIcon? I tried this way but it still didn't work with DrawIcon. What exactly is the format for a DrawIcon icon? Thanks very much. Hopefully I won't have to bother you again. :-) --Jeff Hartkopf, hartkopf@tramp.Colorado.EDU
dlyons@Apple.COM (David Lyons) (06/13/89)
In article <9365@boulder.Colorado.EDU> hartkopf@tramp.Colorado.EDU (HARTKOPF JEFFREY M) writes: >To Dave Lyons: For some reason I couldn't get this letter to you through >E-mail like I was able to with my first one, so I'll post it... Actually, I think your letter did get through...it's probably lying on my floor. (All together now...let's say "Dave is way behind and really should never print out a message instead of replying to it immediately.") >[...] I figured out how to draw an icon in a dialog box using NewDItem, where >the format for the icon was > >MyIcon: >record > BoundsRect: Rect; > Data: Array[1..11, 1..7] of byte; >end; That's fine. Even better than Array[0..xxx] of byte, since it makes the structure more obvious. It doesn't matter how many bytes you put on a line, as long as your declaration matches your StuffHex statements. >or whatever (this for the Dialog box version). Now in your letter to me you >said I should do it using an array of char like array[0..200] of char, and >then using StuffHex like > >StuffHex(@MyIcon[0], '1029492412a2'); >StuffHex(@MyIcon[6], '........ > >and so on. Is this the method for IconItem's or DrawIcon? You can StuffHex for any purpose you want. It'll work for either iconItems and for DrawIcon icons, but you need to stuff *different* data for DrawIcon than you need to stuff for iconItems. >What exactly is the format for a DrawIcon icon? See Toolbox Ref Vol 2, page 17-3. The format is different from DrawIcon. >--Jeff Hartkopf, hartkopf@tramp.Colorado.EDU --Dave Lyons, Apple Computer, Inc. | DAL Systems AppleLink--Apple Edition: DAVE.LYONS | P.O. Box 875 AppleLink--Personal Edition: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.
hartkopf@tramp.Colorado.EDU (HARTKOPF JEFFREY M) (06/13/89)
In article <32384@apple.Apple.COM> dlyons@Apple.COM (David Lyons) writes: > >You can StuffHex for any purpose you want. It'll work for either iconItems >and for DrawIcon icons, but you need to stuff *different* data for DrawIcon >than you need to stuff for iconItems. > >> [I wrote] What exactly is the format for a DrawIcon icon? > >See Toolbox Ref Vol 2, page 17-3. The format is different from DrawIcon. This is great, and I know I need those manuals but I haven't been able to get them yet. However I really need to know the answer to my question (format for a DrawIcon icon) now, so if someone would be so kind as to summarize for me what it says on page 17-3 of Volume 2, I would be VERY grateful. In particular, if they give an example of making an icon of the right format and with the right kind of data for DrawIcon. Thanks so much. Jeff Hartkopf hartkopf@tramp.Colorado.EDU University of Colorado at Boulder