Quick reference for those future readers:
@Crutch mentioned Tech Note #306. I found Apple still has these old Macintosh Technical Notes on their developer website. Here is Macintosh Technical Note #306.
I searched using this page but sadly I couldn't find it by searching "tech note #306" or...
Also -- weirdest thing but your demo app (and my similar approach) ends up calling the IconGetter() function twice per PlotIconMethod(). Inside Macintosh says this should happen once per screen that intersects the rect you're working with -- I only have one screen so I'm a little confused by this.
Yes. And I keep calling ReleaseResource(myHandle) instead of DisposeHandle which is probably my gateway to fudging up things. Perhaps I should be more surprised that I haven't fudged up the resources in any of my other applications I've run in my testing...
Thanks.
Wow - as I was messing with all this and the memory leak and Releasing resources I managed to damage my Finder (and more?). To the point where the Finder's icon suite was messed up and so was its reported ProcessType. Very funky stuff. I'm guessing the memory I was releasing or writing to...
Ill be there showing off my app for System 7, MacDock! J/k but I will try to fly out if I can make low cost arrangements.
Actually it’d be cool to see the wifi blue scsi stuff so I’ll keep an eye out for you all.
I’m also hoping to snag an imagewriter if I see one on the free area table
One thing I don't get about the above code is that if I write an app where I have to use this PlotIconMethod(....,IconGetter,...) function a lot, there is a memory leak. Because you call NewHandle(...) but never ReleaseHandle() or ReleaseResource().
I'm *not* criticizing your code, but rather...
Did you just have to recap the analog board (to get to current samasi mac state)?
bet you it is a mux issue. Next recap the motherboard, it no change then check muxes?
Yes! Wow.. I found it. I was declaring (and defining) my IconGetter(...) function as:
Handle IconGetter(ResType iconType, Ptr data);
I was missing the word pascal. Correcting it to (as your code had it):
pascal Handle IconGetter(ResType iconType, Ptr data);
...fixed my problem! While...
Yes just as you said.
Youre description of how it is supposed to work is totally in line with what Inside Macintosh says so I believe you and it. I must be flubbing something.
ill try your code directly soon and just be sure I get your results (just for good measure).
And i should spend more...
A few questions --
My ThinkC 5.0 doesn't seem to have the GetIconMethod(..) function declared in any of its available .h files.
I typed in the definition as you had it though and it seems to work because it does ultimately call my IconGetter function which I can debug with breakpoints.
However...
Agreed that PlotIconID will do what you say. Inside Macintosh phrases it as "PlotIconID selects the most appropriate icon resource for the current bit depth of the display device and the rectangle in which the icon is to be drawn"
However, PlotIconID(...) takes an integer as the ResourceID...
Thanks again for this awesome clue.
Following up on trying it:
gdPMap is a pixelMap object which has many fields itself (see Inside Macintosh - Imaging with Quickdraw - Pg 4-10)
the **pixelSize** field is what I'm *guessing* you had in mind, @Crutch , but let me know if that's wrong.
So see...
Yes. Inside Macintosh’s QuickDraw book explains this “DeviceLoop” callback system. It seems to be the mechanism for an app to span multiple graphics devices even if tthey have different bit depth etc.
Wondering how to determine current color depth in System 6 and 7.
For example - if my app wants to know if it should show color or not - it should check something no doubt that tells it whether the current screen (GDevice likely) has color or not as well as what bit depth it's set to.
Best I...
Quick update -
With the great help of folks over at 68kmla, based upon the suggestion from Crutch on here, the AppleEvents thing was figured out.
Link to thread here but for continuity here's the deal:
Only a portion of scriptable calls are in the Finder (at least in as late as 7.5.5)...