America Online APPLE II DEVELOPMENT FORUM CONFERENCE LOG Tuesday, April 24, 1990 10:00 p.m. edt Topic: Apple IIGS Toolbox Programming Forum Leader: Dave Sugar (AFL Dyfet) AFL Dyfet Okay, all sillyness aside, welcome to the Apple II Development Forum. Tonight AFL Dyfet our topic is the Apple IIgs toolsets, which should mean plenty of questions for AFL Dyfet Dave L to answer :)...We will be using PROTOCOL tonight starting now, so if you AFL Dyfet have a question on tonight's topic, enter a '?' on a line by itself, and if you AFL Dyfet wish to comment, enter a '!' on a line by itself. You will each be called in AFL Dyfet turn...the floor is now open for questions... AFL Dyfet Okay, Coach, you have the floor now...GA... Coach101 In one of folders here a question was posted regarding the existence of Coach101 a call/toolset/whatever that would do the "little red thermometer" Coach101 operation. A comment was made that it was a GS/OS call. Is there such Coach101 a call? and, how do you use it, if it exists, ? Coach101 ga AFL Dyfet GA Dave... Dave Lyons There's no direct support for it in the system, as far as I know. The Finder happens Dave Lyons to implement its little red bars as custom controls, and if somebody wants to write one, Dave Lyons it would make a really good example of a custom control. ga Coach101 Thanks, and while I have the floor, Coach101 Matt, many thanks for the excellent article on caching and how its Coach101 done by GS/OS in the latest DEVELOP magaizine. () () () Coach101 done AFA Gary J (yeah Matt!!) Matt DTS AFL Dyfet GA Scott, (good work, Matt!)... AFL Scott Why custom controls, Dave? One would think that a user item would be enough AFL Scott correct? AFL Dyfet GA Matt... Matt DTS User items are just fine as long as you're using the Dialog Manager for everything. Matt DTS If you're not, a custom control is the easiest way to go about such things. GA. AFL Dyfet GA Gary... AFA Gary J Can someone tell me what is the latest version of GSBug? APDA Catalog says AFA Gary J it's 4.0b1. The developers were sent 5.0d4, and the acutal GSBug Init shows AFA Gary J 1.3d17. I'm confused :) AFA Gary J GA AFL Dyfet GA Matt... Matt DTS The version number of the *disk* bumped up to 5.0 from 4.0 when the system software did. Matt DTS The version of the debugger itself is still in the 1.3 range as released through APDA. GA. AFA Gary J So the latest DISK version is 5.0d4? AFA Gary J (If so, then why is APDA listed as 4.0b1?) AFA Gary J GA AFL Dyfet Perhaps slightly out of date :)? AFA Gary J Like a year off? :) AFL Dyfet Or maybe they are distributing with 4.0 for some other unfathomable reason... AFL Dyfet maybe an editing error?? AFA Gary J Probably the latter. Thanks. GA Matt DTS I think a newer version will be forthcoming from APDA soon that will end all the confusion. Coach101 I do not think APDA ever updated their debugging package Coach101 to 5.0 stuff. Matt DTS The change in disk numbering to 5.0 never made it to APDA, as that package was never updated. Matt DTS AFA Gary J Thanks. That explains it. AFL Dyfet Okay...do we have any other questions for tonight? AFL Dyfet GA Bytemaster, you have the floor now... Bytemaster I'M NEW . Can somebody tell me what error $0003 in SysFailManager is? AFL Dyfet GA Dave, I knew you'd be first :) Dave Lyons The SysFailMgr toolbox call can be called with any number from 0-FFFF and any string, so you can't Dave Lyons tell what it is just from the number. (A lot of errors codes come directly from Dave Lyons tool errors, but 3 isn't one of them.) So, what we need to know is Dave Lyons what program was tring to start up/etc when you got the error? Was there any message there besides Dave Lyons the generic "Fatal system error"? Bytemaster Yes. I got it after executing a quit call (all tools shut down) It says UNABLE Bytemaster TO LOAD NECESSARY TOOLS Dave Lyons Okay, that was the Finder calling SysFailMgr Dave Lyons when it had trouble starting up all the toolsets it wants. That means the program you were quitting Dave Lyons did not properly shut down all the toolsets it was using. ga Bytemaster Im unsure of the quit call paramaters AFL Dyfet You need to call shutdown on whatever tools you started in your application Bytemaster I have i4'0' i2'0' ga Dave Lyons Bytemaster, Dave Lyons it's not the Quit parameters that are wrong. For example, if your program starts up Dave Lyons QuickDraw (using QDStartUp), you need to shut it down *before* you quit, using QDShutDown; same goes Dave Lyons for all the other toolsets that you use. What language are you using? Dave Lyons (Duh, you're using Dave Lyons APW Assembly...remind me to pay attention to your Dave Lyons "i4"s :-) AFA Gary J (Could be ORCA/M :) Bytemaster orca/m Dave Lyons I was just wondering if you were using ORCA/Pascal or something, where you had some stuff Dave Lyons provided for you like StartDesk/etc that would confuse matters more, but never mind. Dave Lyons You could possibly Dave Lyons be shutting things down in the wrong order, too--there's a technical note on starting Dave Lyons and shutting down toolsets, w/ recommended orders. Matt DTS (IIgs TN #12, by the way.)_ Dave Lyons Oh, and HeadCase points out that I should tell you to use StartUpTools and ShutDownTools, where are Dave Lyons new with System Software 5.0 & documented in Toolbox Reference 3 (at APDA). Dave Lyons ga Dave Lyons (StartUpTools & ShutDownTools take care of the details (like order) for you, making life simple.) Bytemaster Thanks I thought I shut all down but I'll recheck all GA AFL Dyfet Okay, DL Davies is next and has the floor now... DL Davies This is for those with experience using LinkIIGS. The manual states that you... DL Davies can use wildcards in the script. EX: -lseg:code MAIN1 data/= DL Davies instead I have to do this.... DL Davies -lseg:code MAIN1 data/data.root data/data.a DL Davies Any simple way to get around this....ALSO....... DL Davies what does everyone think of ZapLink, better or worse than LinkIIGS...GA AFL Dyfet GA Coach... Coach101 I do not have an answer to your -lseg problem... sorry... the Coach101 manual sure implies what you did should work. On the ZapLink comment, Coach101 the specifications I have seen for ZapLink indicate that it will not Coach101 handle all of the cases that LinkIIgs handles. I like a very "robust" Coach101 linker so I will stick with LinkIIgs.. ga DL Davies Yes, I noticed! You can't specifly segment types (code, data, etc.) Coach101 or RTLs, which I play with.. DL Davies :) AFL Dyfet RTL's? Hmm...KRAM, Coach?? :) Coach101 Yep... 50% converted to assembler/RTL AFL Dyfet Hmm...I have a network email program just looking for something like that :) AFA JoeyS (network email?? ) Coach101 Has Joey had a tetanus shot? AFL Dyfet Yes, with gateways, Joey :)... AFA JoeyS :) DL Davies Oh...if we are on the subject of networks.... DL Davies I have a little TALK program I wrote that splits the screen in two DL Davies and lets you talk to another person on the network. DONE! GA AFL Dyfet Hmm...Okay, Coach has the next question...GA Coach... Coach101 First a correction, Dave informs me that ZapLink does work with RTLs Coach101 so I must have mis-read the specs on ZapLink. Sorry Mike! Dave Lyons Oops! Hey, Coach101 ga Dave Lyons I wasn't talking about Run-Time Libraries...I was only talking about opcode $6B, RTL, the kind that Dave Lyons goes with JSL! ga DL Davies :) hehehee AFA Gary J :) Coach101 Pass the wet rag, my face is covered with EGG :) Coach101 I owe you one Lyons :) Coach101 My question is, suprisingly, sort of network oriented. If I have a Coach101 code module that is not part of the running application (for example, an Coach101 Init, Driver, etc.), and that code wishes to, asychronously, put up Coach101 a message to the user (kind of like "oops, your server went away"), what Coach101 precautions do I need to take to assure that I do not mess up the Coach101 running applications context, windows, etc. ga Dave Lyons Very good question...first, you should probably use the Scheduler to make your code get called Dave Lyons when the BUSY flag is 0 (this way it's safe to make QuickDraw calls). 'course, then you Dave Lyons have other cases to deal with, like text-based apps that never call Dave Lyons INCBUSY and DECBUSY...your task could sit there forever waiting to execute. Dave Lyons GS/OS provides Signals, which may be useful--write to DTS if you want more info on that, since I Dave Lyons don't have it in my head. Dave Lyons You'll want to preserve Dave Lyons the bitmap under your window, probably, in case you're running under an app that doesn't know how Dave Lyons to update all its windows. (If they haven't even started up the window mgr, you might just use Dave Lyons a text alert, like GS/OS does for the Format/Erase dialogs). The Tool Locator has two calls that Dave Lyons should be really handy for you: SaveTextState and RestoreTextState. ga Matt DTS And it gets even worse - if you use a Window Manager call while the application is in the middle Matt DTS of an update event, the Window Manager will eat the application's VisRgn and UpdateRgn for lunch. Matt DTS (This is a problem currently in the OS, as is discussed in a TN - if you need a disk, the OS may Matt DTS put up an alert window while your update region nad vis region are swapped - bad news since that Matt DTS adds more to the update region, which is really the VisRgn, which is really a pain.) GA. Dave Lyons Ack! Good point. I was going to say that TaskMaster almost certainly keeps the BUSY flag Dave Lyons incremented around the BeginUpdate, call the contDraw routine, EndUpdate calls, but that's no Dave Lyons help at all if an app or DA calls BeginUpdate and EndUpdate separately. Ick. Also, Dave Lyons if your code is getting called by a completion routine or interrupt routine, *don't* put it in Dave Lyons a dynamic segment. Two reasons: (1) What Matt said, since the OS will put up a window to ask Dave Lyons for the disk if it's not online. (2) The Loader isn't reentrant, so you'll toast things if you Dave Lyons happen to interrupt a Loader call already in progress. ga Coach101 Ok, thats a lot to digest.... Coach101 I think I remember reading the TN and saying to myself "thats a lot to Coach101 ask of an application" and then thinking "Apple will fix this someday Coach101 I hope, I hope" :) Dave Lyons Which part, Coach? Dave Lyons (Oh...VisRgn stuff...got it.) Coach101 My code is memory resident so loader is no concern. The scheduler, adn Coach101 praying that the application is using Taskmaster seems to be the only Coach101 reasonable approach for the moment. (of course, GS/OS console driver Coach101 if text screen is up). Thanks for the info ga. AFL Dyfet GA Cecil... CecilFret Thanks. I suppose it was a screwy way to learn C but at age 53 had to start... CecilFret somewhere. I took on Lichty and Eyes book and converted their code to C.... CecilFret Needless to say, it took a while. So I have a disk available with all the c>> CecilFret c code. Next, I took on Sandy Mossberg's series in Call -A.P.P.L.E. In his CecilFret code and my c code we both call OsShutdownGs with a shutflag of 2... CecilFret That is the power down call. THe thing crashes. As I was sitting here CecilFret waiting I noticed neither Sandy nor I shut down the tools we have started. CecilFret we only did a DeskShutDown. Could this be the problem, not shuttin down the CecilFret tools??????? GA AFL Dyfet GA Dave... Dave Lyons You should be okay not shutting down the tools, since I don't think the Finder shuts much down Dave Lyons before it calls OSShutDown either. Once upon a time, Dave Lyons there was a problem where it would mess up if you had the Window Manager started up but had *no* Dave Lyons open windows (even an invisible one would save you). I believe that was fixed in 5.0, tho. Any Dave Lyons ideas, Matt? ga Dave Lyons Well, what sort of crash is it? Is the address Dave Lyons in any of your GS/OS drivers, for ex? Matt DTS That was fixed in 5.0. I watched Steve fix it. Matt DTS I just did it from the Monitor and it worked fine for me from in the middle of the Finder. Matt DTS Sorry, Cecil. GA. Dave Lyons Cecil, can you successfully shut down your system from the Finder? CecilFret Ok, first of all I am using ProSel, not the finder. Second, I am using a CecilFret dialog box from which I tell user to to a warm start or a Power down. Dave Lyons (If not, then you've got mismatched versions of drivers or FSTs.) CecilFret I am in 80 column mode at the time. The message comes back fine about CecilFret do you wish to restart, The restart button is there. When I click itI get CecilFret the dreaded bong and have to three finger salute. CecilFret ga Matt DTS You're in 80-column text mode with the desktop tools started? CecilFret No, hirez Matt, sorry. CecilFret No window open Dave Lyons Is there anything on the screen w/ the Bong, Cecil? CecilFret ga Dave Lyons (I like hex numbers.) CecilFret No, dave. Just the button CecilFret No hex, no code, just bong Dave Lyons Very weird. You didn't turn off text-page shadowing, did you? CecilFret not that I know of. Like I said i do a destshutdown and that's it. CecilFret the screen goes blank and I get the message, etc. CecilFret ga Dave Lyons Wait! Matt DTS (we're waiting) Dave Lyons Why are you doing a DeskShutDown if you aren't supporting New Desk Accessories? Dave Lyons (But Darn...that's not going to cause his problem. DeskStartUp would cause problems, but shutdown CecilFret My About box shows control panel plus aobut who did it. ga... Dave Lyons should be fine, since the system keeps doing that anyway [during Quit & at boot time].) Hmmm. Matt DTS When does this dialog show up, Cecil? CecilFret wait! Matt DTS (and is it a text dialog or desktop dialog? I'm still confused on this.) Matt DTS (we' Matt DTS (we're waiting) CecilFret I am trying to find the right magazine. I thought it was winter quarterly. CecilFret The dial shows up as a result of pulling down a menu item. ga Dave Lyons In *regular* hi-res, right? No QD or Menu Mgr or anything. CecilFret Running QD. Plain vanilla. Just like Hodgepodge CecilFret ga Matt DTS HodgePodge uses all the tools, Cecil. now are you or are you not using SUPER Hi-Res and the desktop Matt DTS tools? CecilFret Hmm. Not sure. On shaky grounds right now. I open it 640. ga Matt DTS CecilFret The code is in the Winter Quarterly of Call -A>P.P.L.E. ga Matt DTS It crashes in Sandy's version also? CecilFret that is a big 10-4 Matt. BTW, we are calling modaldialog with a filter. ga Matt DTS Do you close the dialog before calling OSShutDown? Dave Lyons (Cecil, 320x200 and 640x200 are *both* Super-Hires. Ya confused me by saying "hirez" [280x192].) Dave Lyons (Does that matter?) CecilFret Looking! CecilFret The answer is no, Matt ga Matt DTS (It might - the Dialog Manager might get confused by the Window Manager messing with the desktop Matt DTS behind its back.) Dave Lyons Matt, bring up a modal dialog in the Finder & try OSShutDown with it up. Dave Lyons I don't see how it's going to get confused, considering the Dialog Manager is never going Dave Lyons to get control of the machine again. Matt DTS Where does the Finder use the _ModalDialog tool call? Dave Lyons Matt, the Finder uses ModalDialog when you click the About... button in my Memory Bar NDA. Dave Lyons (Should be an okay test, no?) CecilFret I think you have givenme some ideas. I will try both shutting down the CecilFret tools and closing the dialog box. Enough for me for now ok? Thanks guys ga Dave Lyons Cecil, be sure to check that your machine shuts down successfully from the Finder--it could be Dave Lyons that your system is installed Weird. Matt DTS It works just fine with a Modal Dialog in front. Reboots with no message. Matt DTS More importantly - make sure your system shuts down from Finder *after* your program's been run. CecilFret Hmmm. REloaded with 5.02 after a disk crash...ga Matt DTS You might be trashing memory in the OS. I believe C was designed to facilitate this. Dave Lyons Eh? CecilFret AMEN!!!!!!!!!!!!!!!!!!!!!!!!!! and wipe control panel stuff!!!!! ga Micol Sys C was designed to facilitate trashing memory in the OS? CecilFret Needless to say I trashed a lot with C. Darned pointers!!!! ga Dave Lyons I don't think anyone who has intentionally done a DisposeAll($3000) is allowed to take whacks like Dave Lyons that at C. :-) Coach101 :0 Coach101 :) Matt DTS But I did it from assembly, where at least I could see what was happening. CecilFret Thanks guys. It is late in Iowa AFL Dyfet All we need is memory protection...and virtual memory, while we're at it, and AFA Gary J hehe AFL Dyfet C behaves fine :) Matt DTS "It's morning in America..." CecilFret Phooey to you AFL DYfet CecilFret I could learn to hate C yesterday. ga Dave Lyons Matt, can you say "asm { brk 0 };" ? I knew you could. :) Tamira :) Matt DTS Yeah, to see what's going on you have to use the inline assembler. Reinforces my point. Dave Lyons Okay, FINE. Here's how to BRK without using inline assembly. Dave Lyons blah() { int x=0; *((void *)&x)(); }; And then you adjust S and step from the RTL address. :) AFA JoeyS You're sick, Dave. :) Matt DTS And you call that readable. Take some pills, Lyons. AFL Dyfet Matt, you can always #define Dave's mess into a simple BRK :) Dave Lyons #define I_WISH_TO_BRK_HERE asm { brk 0 }; No prob. Matt DTS Yeah, at least I didn't write a P8 shell that uses illegal filetypes and steps on reserved memory. Matt DTS Dave Lyons Feature war! My shell doesn't step on reserved memory out of the box, but you can write your Matt DTS Dave Lyons own command to do it! :-) Micol Sys Don't you just love the friendly spirit of co-operation between Apple employees Tamira lol AFL Dyfet Actually, other than $300, I found a nice chunk that AppleWorks overlays in the AFA JoeyS LOL Ron :D AFL Dyfet banked ramcard around $d100-$d400 :) Matt DTS We know AppleWorks does it too. We pick on them just as much as we do you. Dave Lyons (Matt, be sure to point you that you haven't writen a shell that steps on reserved memory.)