mikeash.com pyblog/friday-qa-2012-01-13-the-mac-toolbox.html commentshttp://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#commentsmikeash.com Recent CommentsThu, 28 Mar 2024 15:37:54 GMTPyRSS2Gen-1.0.0http://blogs.law.harvard.edu/tech/rssGraham Cox - 2013-02-28 12:50:39http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#commentsNice trip down memory lane :) <br /> <br />Of course, even waaay back in the day, sensible programmers didn't use this kind of procedural boilerplate, but wrote an object wrapper around it. I started with Object Pascal, then THINK Class Library (TCL), the first version wasn't even C++ but some weird C thing with some proprietary object extensions - but there was MacApp, later CodeWarrior (C++) and even my own (dare I mention it!) MacZoop (C++). <br /> <br />These would be much more familiar to a Cocoa programmer today than raw toolbox stuff.d054c956b3fecaf77dacb9821a36b552Thu, 28 Feb 2013 12:50:39 GMTGwynne Raskind - 2012-01-21 19:22:19http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#comments<b>Uli:</b> It's not for compatibility per se, but rather it's purely a matter of I never did know for certain which things were and weren't part of any given system version :). I was still putting in <code>diskEvt</code> and <code>inSysWindow</code> stuff right up until Carbon Events came along.674f09df5a1b00709301e8e6270446b6Sat, 21 Jan 2012 19:22:19 GMTUli Kusterer - 2012-01-21 07:11:05http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#commentsOh, also, the disk event (to handle inserting and mounting/initializing of disks) is a System 6 thing that wasn't necessary with Multi-tasking anymore, while Apple Events were new with System 7. Similarly, all the inSysWindow etc. was abolished in System 7. The app is mixing &amp; matching a bit for compatibility, I presume :-) <br /> <br />Also, I would at least add a stub function for the update event between the BeginUpdate()/EndUpdate() calls, or a call to DrawControls or somesuch.60b0df0d844c8009bc0dbf3ef1c26fdfSat, 21 Jan 2012 07:11:05 GMTUli Kusterer - 2012-01-21 07:05:45http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#commentsGwynne, Mike, nice article, thank you! <br /> <br />Just a short correction: IdleControls() is a fairly new call. There were no pre-made "edit text" controls until the Appearance Manager, only dialog items (which weren't all controls). Giving idle time to pushbuttons and scroll bars wasn't necessary at that time. <br /> <br />Apart from that, it is a nice example of a System 7-style application.3f1ea94856645cb878c4059bb04a1670Sat, 21 Jan 2012 07:05:45 GMTJeremy W. Sherman - 2012-01-18 19:46:40http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#comments<b>Joachim</b>: You'll find the classic Inside Macintosh books and much besides in the legacy documentation portion of Apple's developer site: <a href="https://developer.apple.com/legacy/mac/library/navigation/">https://developer.apple.com/legacy/mac/library/navigation/</a>. <br /> <br />One legacy doc worth skimming is TN1122 "Locking and Unlocking Handles" (<a href="https://developer.apple.com/legacy/mac/library/#technotes/tn/tn1122.html">https://developer.apple.com/legacy/mac/library/#technotes/tn/tn1122.html</a>). It was years before Apple realized you could readily mess up the state of something that's either locked or unlocked without a count: your callstack nests, but your lock/unlocks don't, so you have to take care to save and restore that state manually. You'll likely run across code making this same mistake but with a different (more modern) resource at some point.1aae42ce16972cc6c45ac0527ed9e8a2Wed, 18 Jan 2012 19:46:40 GMTJoachim Bengtsson - 2012-01-17 22:21:13http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#commentsAs a kid I loved digging into the innards of applications using ResEdit (even after warnings from my older brother that doing so would most certainly break something). When I finally got into programming, I only got as far as simple REALBasic apps. It wasn't until '04 or so that I learned C, and by then it was all Objective-C. Ever since, I've been curious about that mysterious Toolbox I've heard so much about. Not curious enough to get a book and actually *learn* it, obviously and unfortunately... So I was very happy to read this intro, thank you! I'm really really looking forward to further posts on the topic!0755ee500eabd58b3c87a82c90d849deTue, 17 Jan 2012 22:21:13 GMTSean Patrick O’Brien - 2012-01-17 09:13:39http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#comments<b>Ian</b> You're right about it being a 4P4C, but for some reason the engineers originally referred to it as an RJ-11 jack, and so it stuck. You can see it labeled as such on the 512K logic board schematic on the bottom right (designated as J9): <a href="http://www.digibarn.com/collections/diagrams/mac-512klogicboard/mac-logic-schematic.jpg">http://www.digibarn.com/collections/diagrams/mac-512klogicboard/mac-logic-schematic.jpg</a>863ffb9b8dff03515ad8ee333f7512faTue, 17 Jan 2012 09:13:39 GMTHenry - 2012-01-14 18:29:48http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#commentsThe event handling code look quite similar to how it's done in low-level X Windows.7f46017ba4b19c262e75113da758ec1dSat, 14 Jan 2012 18:29:48 GMTPeter - 2012-01-14 11:06:04http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#commentsGood things don't suffer from age, they suffer from everything else getting better, don't they? :-)dac561c52adf5c5993e8725df6e0c61dSat, 14 Jan 2012 11:06:04 GMTNicholas Riley - 2012-01-14 03:19:56http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#commentsOther small nit: the B&amp;W displays were 512x342. 512x384 was for the lowest-resolution Mac color displays that Apple ever sold (e.g. the 12" display that matched the LC's width, or the Color Classic).4f3c29be141930f41f2716f638f3b369Sat, 14 Jan 2012 03:19:56 GMTGwynne Raskind - 2012-01-13 21:54:29http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#comments<b>Ian:</b> Completely possible! My information on that particular model comes from Wikipedia and nothing else; I never personally owned a Mac older than the SE/30. For that matter, I've only ever seen an actual Mac 128K once :). It's not what you'd call a common find these days.a609711e7cabfa7d9ef8ff470079ff49Fri, 13 Jan 2012 21:54:29 GMTIan - 2012-01-13 21:45:45http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#commentsPedantic Moment: I may be wrong, but I'm pretty sure that it's a 4P4C, non-registered jack on the original Mac keyboard and not an RJ-11.a857881c609ba694e855d503092f174cFri, 13 Jan 2012 21:45:45 GMTmikeash - 2012-01-13 21:10:33http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#commentsApologies to both readers and author, I forgot to add the byline when I uploaded it. It's fixed now. It is indeed Gwynne.61ee760f5ce6ee5866d42d4c4a35a583Fri, 13 Jan 2012 21:10:33 GMTSeth Willits - 2012-01-13 20:48:00http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#commentsGwynne Raskind I believe.8439f4a3acc8aae1954412d66ab5d1fdFri, 13 Jan 2012 20:48:00 GMTBJ Homer - 2012-01-13 20:09:10http://www.mikeash.com/?page=pyblog/friday-qa-2012-01-13-the-mac-toolbox.html#commentsSo... who is the guest blogger? As far as I can see, there's no attribution other than "This is my first guest post of 2012, and also my first one writing the introduction myself." <br /> <br />So, not-Mike, thanks for a trip back through history. We'd love to know who you are.dd9260a5c75a17e6838be6f7ec53920cFri, 13 Jan 2012 20:09:10 GMT