America Online APPLE II DEVELOPMENT FORUM CONFERENCE LOG Tuesday, May 26, 1992 10:00 p.m. Eastern Time Topic: Assembly Forum Leader: Gary Jacobson (AFL GaryJ) AFL GaryJ Welcome to the Apple II Development Forum! AFL GaryJ Tonight, our topic is Assembly Language Programming! AFL GaryJ Let's use forum protocol tonight..... so if you have a question, type a "?" on a line AFL GaryJ by itself, or if you have a comment on the current topic, type a "!" on a AFL GaryJ line by itself. AFL GaryJ I'll call on you when it's your turn. AFL GaryJ Anyone have any questions they'd like to start out with this evening? Nuzz I have a question regarding Picture Controls Nuzz I was trying to create a picture control where the control def was a pointer, and the picture Nuzz def was a handle. I couldn't get it to draw the picture. I stepped throught he code Nuzz with GSBug, no errors were returened. Nuzz If I just do a DrawPicture with the handle it drasw fine. Nuzz and, just curious but how come a picture def can't be a pointer Dave Lyons Blehhh...Hmmm...checking to see how that works, I'll have something in a minute.... Dave Lyons (Can't be a ptr because QD uses GetHandleSize to know how big the picture is.) Matt DTS QD only deals with pictures in handles, Mike. Nuzz Ok, I'll buy that ;) Dave Lyons Got an idea.... Dave Lyons What is the control rectangle for your Picture control, and how does it compare to Dave Lyons the frame rectangle embedded in your picture. If you are magnifying the picture slightly when you Dave Lyons draw it, then if the Clip Region was "wide open" (-16383,-16383)(16383,16383) when you recorded Dave Lyons the picture, the clip region gets magnified outside the valid coordinate space & nothing gets drawn Dave Lyons (or other bad things happen, but nothing getting drawn is typical). Possible? Nuzz Dave, offhand I don't know. I created ta picture control with Genysys, it displays Nuzz properly when its a resource. I then saved as source, put the pic def in a handle and then had the pro Nuzz problem. I never looked at the rectangle.. Dave Lyons When you "just call DrawPicture" what rectangle do you pass? Dave Lyons (Takes a rect & a picHandle.) Nuzz I'll check that size though... Nuzz I use the same rectangle in _Drawpicture as I do for the control Nuzz 89,196,129,406 Nuzz I took the rect right from the control def Dave Lyons Blah. I don't know what's going on, but I just learned that if the bottom of your picture Dave Lyons control rectangle in the template is 0, it figures out the right size from your pic frame (that Dave Lyons is, no scaling). Surprise. Dave Lyons So, when you do the DrawPicture your port is set to the window containing the control, right? Nuzz Yes, all the other controls are drawwn Nuzz I've already worked around it so if you want to go on, its fine by me.. Dave Lyons Well, I'm stumped...send along something reproducible if it's convenient. Dave Lyons (My mistake, the bottom-(0,0) thing for picture ctls *is* documented.) McKinsey I have two. Both are related to something I don't have much experience with: McKinsey TextEdit. McKinsey Between a _TESetText and a _TEGetText to write the text to disk, how can I McKinsey tell if the data has been changed without keeping two copies and comparing? Sheppy Busy flag. It's in one of the flag fields in the TERecord. Matt DTS (ask second question -- searching TNs) McKinsey Ok, my second question is how to go about handling windows through finder McKinsey extensions... McKinsey I've used ModalDialog and I've used NewWindow2 (w/taskmaster). Both work McKinsey fine, which is the safe way? McKinsey Or perhaps I should say, is there anyway for a Finder Extension to bring up McKinsey a window, and then let it "multi-task" with other windows and the finder? Matt DTS Back to first question -- see the last three paragraphs of IIgs TN #92 for the full story. Matt DTS Dave will have something to say on the "modal update" problem, but the easiest/safest way is... Matt DTS ...probably to use DoModalWindow. Although I can think of no reason why dialogs _wouldn't_ work, Matt DTS ...they're still limited and won't support extended controls and I'd shy away. Dave Lyons I prefer Window Manager stuff (NewWindow2 & either TaskMaster or DoModalWindow) to the Dialog Dave Lyons Manager, but DM will also work. -- If you want to be *modeless* as you say, that's even cooler! You Dave Lyons have to use new Desk Manager stuff in 6.0: see GetAuxWindInfo and the Desk Manager docs. Dave Lyons (You can create a window that looks just like an NDA to the application, even if you're not an Dave Lyons NDA yourself.) McKinsey Hmmm... Dave Lyons (Actually, you can create as many system windows as you want without being an NDA! For example, Dave Lyons see the Control Panels NDA.) McKinsey This is what I a program of mine to do: McKinsey Double click on a text file in the finder, and a text edit window pops up, and McKinsey this window is completely "self sufficient" in the sense, that I can still do McKinsey things just as if the window was never opened. McKinsey My program works fine, it just only lets you work with that ONE window. McKinsey I use taskmaster and newwindow2 in a tight loop. Dave Lyons Yup--you need the 6.0 toolbox docs! Available on CD at a Resource Central near you. You can do Dave Lyons exactly what you want. McKinsey Hmmm.. ok.. I have them on my HD somewhere... What's it under? Dave Lyons Desk Manager (data structures) and Window Manager (GetAuxWindInfo). Dave Lyons You need to do a NewWindow2, SetSysWindow, GetAuxWindInfo, stuff a pointer to a static Dave Lyons data structure of your own into the aux wind info, and stuff whatever you need into the window's Dave Lyons refcon. The "static structure" of yours has pointers to the Init/Action/Close routines for Dave Lyons that window, just like it was a real NDA. ga McKinsey Great. Thanks.. McKinsey about the sound cp... McKinsey Accordin go the sound cp dox... McKinsey the sound cp will accept $04/$05/$06 request codes... McKinsey For the life of me, I can't get it to accept 4. It will accept 5 and 6 just McKinsey fine. But not 4. McKinsey To play an rSound, I simply call 4 to have the soundcp load the sound, McKinsey 6 to play it, and 5 to wait. McKinsey But it always returns an error on 4 of "Request not Accepted.". McKinsey any ideas? Dave Lyons Hmmm...that's -supposed- to work...HyperCard IIgs 1.1 uses it to play sounds by name while HC has Dave Lyons the sound tools already started (from a HyperTalk "play" command). Dave Lyons Are you passing the name of an existing sound? If it doesn't know about any sound with the specified Dave Lyons name, it's supposed to reject the request (so that somebody else has a chance to handle it). Dave Lyons Lemme see if it'll accept it for me. Dave Lyons What are you passing as SendRequest parameters? Sending to everybody? McKinsey I pass it the name of an existing sound in the System/Sound directory. McKinsey I've tried everybody AND by name to the SoundCP. McKinsey (Which I think is a no-no). :-) McKinsey Neither worked. McKinsey It could be me... but bugs never take this long for me to weed out. Dave Lyons Works for me...I did this in Nifty List: Dave Lyons 300:6 "Whoosh Dave Lyons _SendRequest(4,8000,0,300,310) Dave Lyons and got no error, and a handle in my result buffer (at 312). McKinsey Ok.. my problem then. McKinsey Thanks. AFC DYAJim (300-400 is always free right?) AFA Jay I was going to mention that, I always do stuff in 00/0300, wondering AFA Jay if it was ok. Dave Lyons Well, 300..3CF is free, yeah. AFA Jay ah, cool :) AFL GaryJ Hmmm.... You used the "_SendRequest" command just like that (with parameters, AFL GaryJ of course) from Nifty List? AFL GaryJ I must have typed something wrong. Dave Lyons Gary, yes. I could have Dave Lyons been more symbolic, using #srqGetrSoundSample instead of "4". Matt DTS Try not to use it in _programs_, guys, so tricks like this will still work. Ask the Memory Manager. AFC DYAJim I always do stuff to e12000. AFC DYAJim I don't care if it overwrites the first line of my menubar AFL GaryJ Dave, the reason I asked is that when I typed the _SendRequest command just as you AFL GaryJ typed it, I got an "** unknown tool name (_xxx)" error AFA Jay Gary, do you have 3.4? AFL GaryJ Yes, Jay Sheppy Do you have the NL data files in the right place? AFL GaryJ OOoops.... (That's the problem) AFL GaryJ I booted from a different disk (older version of Nifty List :) AFL GaryJ Ok... (Moving right along :) AFL GaryJ Has anyone here ordered the ORCA/Debugger? Matt DTS Dave and I have. Matt DTS (Don't have it yet; maybe this week) AFL GaryJ I need to get Mike over here to talk about it, I guess. AFL GaryJ I was wondering about the benefits of having ORCA/Debugger when AFL GaryJ GSBug is soooo goood. AFA Jay Well, Orca/Debugger lets you debug in source... AFA Jay instead of dissasembly. :) Matt DTS If you're writing in a high-level language and don't know assembly well, Gary, it can be invaluable. James S WI Ever try to debug C with it? AFL GaryJ Yes. AFA Jay Sure, if you have lots of tool calls you can find your way through a C program AFA Jay easily... AFA Jay but when you have straight math type stuff, loops and switches... AFA Jay it's not fun to follow :) AFL GaryJ I understand the benefit, now. That wasn't obvious to me from the mailer I got on it. AFL GaryJ GA with your question, Sheppy. Sheppy Anybody know of any INITs, DAs, or such that cause GSBug to totally... Sheppy ...ignore tool breaks? Sheppy I seem to be having that problem all of a sudden. AFA Jay GNO eats them sometimes. Dave Lyons If you can still get into GSBug, browse starting at E10000 & see what's going on w/ the Dave Lyons tool dispatcher. Use Nifty List w on addresses to see whose code you're in. If it's just the ROM Dave Lyons plus GSBug then E10000 jumps to GSBug, which eventually jumps to ROM. Sheppy Oh, I can get in there, trace, etc. But it ignores the breaks. Really Sheppy bizarre. Dave Lyons What GSBug version? Dave Lyons You're doing a TBrkIn, right? Sheppy I see... yeah, I was going to check it out like that, but was hoping Sheppy (yes on TBrkIn) that I could get an easy answer here. Sheppy Ah, life's never that simple, though. :) AFL GaryJ You did get an easy answer here :) AFL GaryJ Does that do it for you, Sheppy? Sheppy I'll figure it out later tonight, then... thanks. GA. Nuzz I have a finder callback question Nuzz I have some code that accepts a Finder Says before Open request Nuzz in this code I do a Get Selected Icons request. THe finder always gives me Nuzz an error "Not now, Finder has a headache" error $4205 Matt DTS (outdated ERS alert!) Dave Lyons Right. You can't do much with tellFinderXXX from inside a finderSaysBeforeOpen. Dave Lyons (What's wrong with his ERS?) Dave Lyons If you really need to do tellFinder stuff, you have to keep track of the pathnames to open & wait Dave Lyons until you get a finderSaysIdle to do the work. Matt DTS (The beta ERSs don't address this at all; the final ones talk about this in a fair amount of detail.) Dave Lyons Why do you need to know what icons are selected in a finderSaysBeforeOpen? Nuzz Thts is where i moved the call, and it does indeed work with Idle Nuzz Because I want to add them to an internal list Nuzz Thats how I track them in SynthInit extension Matt DTS You'll get one finderSaysBeforeOpen call for each _file_ selected when Open is performed. Matt DTS Isn't this sufficient? Matt DTS (You won't get folders, devices, trash can, etc., but you probably don't want these anyway.) Dave Lyons (You also won't get the BeforeOpen if somebody accepts it before you do...not a problem if the Dave Lyons files are all the same type, in practice.) Nuzz In SynthInit, I allow multiple selection, and play the songs one after another when the previous one Nuzz is done playing. Matt DTS So when you get a beforeOpen while a song is playing, add it to your list and wait until you Matt DTS can play. Is this substantially different? Dave Lyons I don't get it. Why not add each pathname to your list during finderSaysBeforeOpen? I don't see Dave Lyons what the GetSelectedIcons is for still. Nuzz Again, I have it working but was curious why my first method failed Matt DTS Oh. Because you have two "z"s in your last name. Finder disallows this, so the call failed. Nuzz Right Matt, thats what I do Dave Lyons (Matt & Dave demonstrate precision interleaved questioning....) Nuzz Nope it's the "M" that does it Matt DTS (This was a major problem in 6.0 testing until Fred Zwerzky resigned...) Dave Lyons The Finder is trying to avoid nasty things that would happen for most tellFinder calls if you Dave Lyons made them from a BeforeOpen. If you closed the window a selected icon was in during BeforeOpen, Dave Lyons using tellFinderCloseWindow, for example, the Finder would crash. So it doesn't allow that Dave Lyons sort of thing. GetSelectedIcons shouldn't have any bad effects, but it gets prohibited along with Dave Lyons almost everything else, on general principles. ga Matt DTS (Sorry, back on topic.) IR has the same problem and the source has voluminous comments/complaints... Matt DTS ...about this very situation. Matt DTS (Mike: Did you read Finder ERS 3.1 and patch Finder in memory before calling GetSelectedIcons?) Dave Lyons [Only for Extended, Matt.] Nuzz Yes I did Matt. But I don't get extened lists (or whatever they are called)