HDTenEightyP/NetNews huggingface dataset:
From: fixer@faxcsl.dcrt.nih.gov (Chris Feelin' Groovy Tate)
Subject: Re: How does my app know that its document was double clicked?
Reply-To: fixer@faxcsl.dcrt.nih.gov
Organization: Computer Systems Laboratory, DCRT, NIH
Date: Thu, 31 Dec 1992 15:46:33 GMT

In article <C04pu0.I5B@netnews.jhuapl.edu>, Robert Jensen <jensen@aplcomm.jhuapl.edu> writes:
>I wrote an application, defined document types, and I can double click on 
>a document created by the application and cause the application to be
>launched.  How does the application know to open the double-clicked 
>document?  I really did study Inside Macintosh, but couldn't figure this 
>out.  Thanks for any hints.

Two ways:

If your application can deal with AppleEvents (which of course any *proper*
application should :-), then you get an 'odoc' event for each document
double-clicked.  Handle these normally, i.e. as you would any other 'odoc'
event that came down the pike.

If your app is *not* AE-aware, you'll get some information passed along to you
at launch time.  You get at this info via the CountAppFiles() routine,
documented in the Segment Loader chapter of IM-II.  CountAppFiles() returns
information about how many documents were double-clicked, along with whether or
not you should be opening them or printing them.  Then, you use GetAppFiles()
and ClrAppFiles() as you wind through the list of double-clicked documents to
get their information and Do The Right Thing.

Note: if you do not support AppleEvents, you'll need to figure out for yourself
that you're supposed to quit after you're done printing documents via a Finder
launch.

Look on pages 57 and 58 of Inside Macintosh II; this is all explained there.

------------------------------------------------------------------------------
Christopher Tate             | Return of the CryptoSig (tm):
Management Systems Designers |    LR KMBVALMH ZKM HD CNDMH, LV CLYY.  LR
                             |    MDVALMH AKT HDMU CNDMH, BDX'QU DQUNYDDEUJ
fixer@faxcsl.dcrt.nih.gov    |    TDIUVALMH.
Newsgroups: comp.sys.mac.programmer
From: rsvanc00@nx39.mik.uky.edu (Randolph S. Vance)
Subject: How can I write AfterDark routines?
Organization: University Of Kentucky, Dept. of Math Sciences
X-Path: nx39.mik.uky.edu!rsvanc00
Date: Tue, 29 Dec 1992 06:48:34 GMT

I want to write AfterDark routines for my system. How can I do this?
What would I need in the way of programming tools?

--------------------------------------------------------------------
 
Randolph S. Vance
 
              RSVANC00@mik.uky.edu (NeXT Mail)
              RSVANC00@ukpr.uky.edu
              RSVANC00@ukcc.uky.edu
 
QUOTE: "I'll watch some TV, it'll help me to RELAX!"
              -Ren Hoek
 
--------------------------------------------------------------------
Newsgroups: comp.sys.mac.programmer
Distribution: world
From: Matt_Harrop@magicbb.uucp
Organization: MAGIC - Macintosh Awareness Group In Canada
Date: Sat, 19 Dec 1992 12:36:10 EST
Subject: moof?

moof?

Matt_Harrop@magicbb.uucp
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.sys.mac.programmer
Subject: Re: What am I doin wrong?
Date: 28 Dec 92 13:18:42 +1300
Organization: University of Waikato, Hamilton, New Zealand

In article <1992Dec27.133008.1@vax1.mankato.msus.edu>, t303grey@vax1.mankato.msus.edu writes:
>
> *** problem 1: (Error checking code are deleted, assume best case)
>
>     GetGWorld( &oldPort, &oldDevice );
>     Err = NewGWorld( &offWorld, 8, &theScreen, NULL, NULL, 0 );
>     SetGWorld( offWorld, NULL );
>
>     pixBase = GetGWorldPixMap( offWorld );
>     LockPixels( pixBase );
>
>     EraseRect( &theScreen );
>
>     SetGWorld( oldPort, oldDevice );
>
>     CopyBits( &pixBase,
>                 &(*(GrafPtr) pCWindow).portBits,
>                 &theScreen, &theScreen, srcCopy, NULL );
>
>     UnlockPixels( pixBase );
>
>   Strange thing about this code is if I substitute the 1st argument of CopyBits
> call to &(*(GrafPtr) offWorld).portBits it works fine.

That's right. The Color QuickDraw version of CopyBits can take three different
forms for the srcBits and dstBits arguments: either a pointer to the actual
BitMap field of a B&W GrafPort, a pointer to a PixMap record (I assume you
have to lock down the PixMapHandle first), or a pointer to the pseudo-BitMap
field of a CGrafPort. It can distinguish these three cases simply by
checking the top two bits of the rowBytes field. For colour work, I find the
third form the easiest to use.

To save typecasting, I modified the definition of the CGrafPort structure as
follows:

    TYPE
	CGrafPort =
	    RECORD
		device : ShortInt;
	    CASE : BOOLEAN OF
	    | FALSE:
		portPixMap : PixMapHandle;
		portVersion : ShortInt;
		grafVars : GVarHandle;
		chExtra : ShortInt;
		pnLocHFrac : ShortInt;
	    | TRUE:
		portBits : BitMap; (* used only for CopyBits/CopyMask/CopyDeepMask *)
	    END (*CASE*);
		portRect : Rect;

		...

		grafProcs : CQDProcsPtr;
	    END (*RECORD*);

But of course this only works with Modula-2...

> But according to IM7 we
> should never dereference GWorld (p21-5 paragraph 3) to get to pixMap. Right?

This has to do with creating offscreen GWorlds on machines without Color
QuickDraw. Since all the ports are B&W GrafPorts in this case, the direct
reference to the BitMap field should still work.

By the way, I assume you already know that GetGWorldPixMap doesn't work
properly in system versions prior to 7.0. Can somebody clarify whether the
bug was introduced in version 1.2 of 32-Bit QuickDraw, or whether it was
present in version 1.0 as well?

Lawrence D'Oliveiro                       fone: +64-7-856-2889
Computer Services Dept                     fax: +64-7-838-4066
University of Waikato            electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
The landscape was snow and green ice on broken mountains. These weren't old
mountains, worn down by time and weather and full of gentle ski slopes, but
young, sulky, adolescent mountains. One yodel out of place would attract, not
the jolly echo of a lonely goatherd, but fifty tons of express-delivery snow.
					   -- Terry Pratchett, "Reaper Man"
From: Sproul@sproul.sproul.com (Mark Sproul)
Newsgroups: comp.sys.mac.programmer
Subject: Re: THINK C bug??
Date: 23 Dec 92 07:32:30 GMT
Reply-To: Sproul@sproul.sproul.com (Mark Sproul)
Distribution: na
Organization: Sproul Consulting
X-Mailer: uAccess - Macintosh Release: 1.6v1

I just upgraded to a quadra 950 and had a problem with Think C 5.01.
I got an "illegal instruction" error in a statement that assigned
a float to an int.  I called up Symantec and they new about it and
said 5.04 fixed it. I down loaded 5.04 update from Applelink and it
fixed the problem.

-----------------------------------------------------
Mark Sproul - KB2ICI - New Jersey
sproul@sproul.com
From: ldh@svl.cdc.com (Lawrence D. Hare)
Newsgroups: comp.sys.mac.programmer
Subject: MacTCP error -23015
Date: 22 Dec 92 18:07:39 GMT
Organization: Control Data Systems
X-UserAgent: Nuntius v1.1.1d9
X-XXMessage-ID: <A75C98ED89030456@ethelred.svl.cdc.com>
X-XXDate: Tue, 22 Dec 92 10:05:33 GMT

I posted this yodel for help once before and despite my best efforts, I
still have one site that is experiencing a problem with the TCP/IP
communication side of an application we have written. So, if anyone has
any experience with this one I would have a very merry Christmas if it
could help me.

System 7.0, the first Tune-Up (V1.0), Mac II, MacTCP 1.1.1. MacTCP
returns -23015 - "The connection came up halfway and then failed".

I have constructed an identical network, tried different configurations,
different OS levels, trap code, trace code, debug code, code code, no
code..... I CANNOT make it fail. Just this one site fails.

Is there any internal debugging technique for MacTCP that might give me
an insight into what MacTCP is seeing? Like some trace code within MacTCP
itself? Short of going on-site with a Lanalyzer, which might not tell me
anything anyway, I am running out of ideas.

Thanks and a Happy Holiday Season to you all.
---------------------------+
Lawrence D. Hare           | Voice:    (408) 496 4339
Principal Consultant       | CntrlNet: (234) 4339
Control Data Systems, Inc. | Fax:      (408) 496 4106
5101 Patrick Henry Drive   | eMail:    ldh@svl.cdc.com
Santa Clara, CA 95054      | AOL:      LDHARE
From: ns1u+@andrew.cmu.edu (Nick Spies)
Newsgroups: comp.sys.mac.programmer
Subject: Sound Manager
Date: 21 Dec 92 11:35:42 GMT
Article-I.D.: andrew.sfBXWi600iV2836mc1
Organization: Carnegie Mellon, Pittsburgh, PA

I would like to use the wave-table synthesizer with four waveforms to
play a chord of four notes. One note (at a time) plays fine but more
than one plays noise the way I've written it.

Any pointers to info on how to do it right (besides Inside Mac, Vol. VI)?

Thanks,
--Nick
Newsgroups: comp.sys.mac.programmer
From: brad@tazboy.jpl.nasa.gov (Brad Pickering)
Subject: Re: Sozobon C - a free C for the Mac, too?
Followup-To: comp.sys.mac.programmer
Organization: Jet Propulsion Laboratory, Pasadena, CA
Distribution: comp
Date: Tue, 29 Dec 1992 19:27:39 GMT

I think this is a great idea.  In fact, this is sort of what I have been
playing with for the past couple of weeks.  What I want to do is emulate
TOS (the atari OS) on the mac so that all of the atari tools can work
on the mac with no changes.  I started with the source to MiNT and
compiled it under Think C tweeking it quite a bit so that it wouldn't
trample the mac os.  So far I have been able to run some very simple
programs like 'echo' and 'cp'.  I still have lots of problems with
more complicated programs like 'sh'.  I am especially having difficulty
with the fork calls.  It has something to do with the code I modified
so that all processes would run in supervisor mode.  Any way, I just
ordered a book on the 68040 so that I could investigate running user
level code on my mac.

Assuming we got something like this running, we could use the same sort
of techniques that MacMINIX uses to write mac code useing a regular
K&R compiler.  In mac minix, mac traps are interfaced by code that loads
the appropriate a5 from a global variable before calling the trap.
Instead of pc relative code generation like most mac compilers, atari
compilers generate relocation information so that it can be relocated
at execution time.  On the mac, we could have the first routine be
a pc relative routine that loads and relocates the TOS formatted exectable
from a resource.  One of the biggest problems with this is in debugging.
Macsbug expects the names of routines to be imbedded into the code at
the end of each routine.  Sozobon C doesn't put this information in
the code, so bugs are much more difficult to track down.

My opinion is that the goal of getting Sozobon C generating Mac Programs
is very doable.  I am very curious about what the atari people think
about this.  Are there any atari people out there who know a bit about
TOS, MiNT, and/or Sozobon C who wouldn't mind a few questions from
some mac people.

Anyway, theres my comments.  I would certainly like to see this discussion
continue.

Brad Pickering
From: werner@dewey.soe.berkeley.edu (John Werner)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Curves in QuickDraw GX
Date: 1 Jan 1993 01:55:32 GMT
Organization: School of Education, U.C. Berkeley
NNTP-Posting-Host: dewey.soe.berkeley.edu

In article <1993Jan1.012608.5403@hobbes.kzoo.edu> k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
>Because the PowerPC will run on a different processor, and the Toolbox
>will be written in the native code for that processor.  If Apple writes
>it in assembly, they have to write it (and debug it) twice.

Also, hand-coding something in assembler for a RISC chip is MUCH
harder than on a traditional processor.  There's a smaller instruction
set, more registers, and you have to worry about pipelining.  A good
optimizing compiler can usually do a better job than most humans can
do (at least in a reasonable amount of time).
-- 
John Werner                        werner@soe.berkeley.edu
UC Berkeley School of Education    
Newsgroups: comp.sys.mac.programmer
From: jimlynch@netcom.com (Jim Lynch)
Subject: Re: Best Mac value of all time
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
Date: Sun, 3 Jan 1993 11:53:09 GMT

Then you include any machine/configuration that was offered new at some time
but not necessarily now? You're talking about the list price at the time?
Xref: sparky comp.sys.mac.programmer:20246 comp.sys.mac.games:13445
From: bowden@csd4.csd.uwm.edu (John William Bowden)
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.games
Subject: Code for drawing a sprite desired.
Date: 23 Dec 1992 16:19:32 GMT
Organization: Computing Services Division, University of Wisconsin - Milwaukee
Distribution: world
NNTP-Posting-Host: 129.89.7.4
Keywords: Bring out the sprites!!!
Originator: bowden@csd4.csd.uwm.edu

Hiya,

 THere is alot of interest in writing games for the mac (myself included.)
If there's a kindly sagelike programmer out there with a little time on
his/her hands, could someone share a technique for copying a sprite from an
offscreen grafPort?

 Here's what I have in mind.  A short program that loads in a PICT containing
a sprite and its mask into an offscreen grafPort and the copyBits the sprite
into a visible window.

 I suspect that anyone who would provide us neophytes with this little
tidbit would earn the undying gratitude of many a ThinkC tinkerer.

 I may just be dense, but pouring over sample code and IM, it is not at all
obvious to me how to use copyBits.

Thanks,
John
From: hruska@ecs.umass.edu
Newsgroups: comp.sys.mac.programmer
Subject: Implementing sliders in think c 5.0.x
Date: 29 Dec 92 03:18:07 GMT


Hello,

Does anyone know if there is any simple PD source out there that shows how to
implement a slider in think C.  I'm interested in making a two-indicator
slider to specify a sub-range in a larger range.  This could be done by using
two one-indicator sliders next to or no top of each other.  However, all of
the examples I have found are in assembly (in the case of the mac scroll bars)
or in pascal.  If anyone knows if there are any working examples of sliders
in think C 5.0 code out there please email me.  
Thank You.

Mark Hruska
hruska@ecs.umass.edu

Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: Macs closed, what me worry?
Followup-To: poster
Organization: Kalamazoo College
Date: Tue, 22 Dec 1992 20:52:26 GMT

ksand@apple.com (Kent Sandvik ) writes:
>nagle@netcom.com (John Nagle) wrote:
>>       It's because if you try to build a machine that runs Mac software,
>> Apple sues you.
>
>:-). That's news to me. I'm sure it's news to Outbound as well.

MacWorld's April 91 issue, p. 122, says:

"Apple's most common response to companies trying to clone its hardware
or software has been to wield its mighty financial and legal weight
against those involved.  Franklin Computer [got sued and lost].  Digital
[got sued and lost].  Cadmus [got bought and vanished].  Outbound
Systems, which like Dynamac and Colby, uses Mac ROM chips for its
portable, seems to have gotten a little too good.  Like Cadmus, Outbound
is now entangled in a confidential and complex agreement with Apple."


By the way, AppleLink's HotNews says:

OUTBOUND IS LAYING OFF 50 of its 60 employees and has ceased manufacturing
its line of portable notebook Macintosh-compatible PC's.  --S.J. Mercury 12/11


Anyone know what action, if any, Apple really took against/with
Outbound?  I trust that issue of MacWorld not at all, seeing as how the
cover (20 months ago, remember) says "Special: MAC CLONES. After 7
years, Apple has competition for the Mac."  :-)

Send me email;  I'll summarize if anyone cares, but this isn't really a
topic for c.s.m.p...
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "Apple developers will still have access to System 7.1 through the
  monthly Developer CD series, but they may use it only for testing
  and development purposes."              - AppleDirect, Nov/Dec 92
From: phaedrus@halcyon.com (Mark Phaedrus)
Subject: Re: How does my app know that its document was double clicked?
Organization: The 23:00 News and Mail Service
Date: Fri, 1 Jan 1993 01:35:18 GMT

In article <1992Dec31.205747.16147@netcom.com> bskendig@netcom.com (Brian Kendig) writes:
>Now I've got a question, too.  How do you cope with double-clicking
>files that belong to an _open_ application?  Does this require the use
>of AppleEvents?  Right now, when I dragdrop a file onto my app, it
>launches and opens the file, but when I dragdrop another file onto my
>app, the Finder says "Some files could not be opened.  Try opening
>them from within the application."

     Well, if you support AppleEvents then you'll get the "odoc" event.  If
not, then the system software has to get creative. :)  It sends you the 
appropriate events as if the user chose "Open..." or "Open" from the File
menu.  When your application calls the Standard File package to let the user
choose what file to open, Standard File doesn't display the Open dialog; 
instead it just returns the data for the document the user double-clicked.
     If you don't have an "Open" or "Open..." command on the File menu, the
Finder displays the "Some files could not be opened." dialog.  You can get
around this by putting two 'mstr' resources in your application; 'mstr' 102
should hold the name of the menu that has your application's open-file command,
and 'mstr' 103 should have the name of the open-file command itself.
     On a related note, if the user tries to shut down the Mac while your
application is open, and you don't support Apple events, the System will use
the "Quit" command on your application's File menu; you can tell it to use a
different command name instead by putting the menu name to use in 'mstr' 100
and the menu item to use in 'mstr' 101.
-- 
\o\ Internet: phaedrus@halcyon.com  (Seattle, WA Public Access Unix)     \o\
 \o\ "How'd you like to move a few steps down the food chain, pal?"       \o\
  \o\ If you enjoy fantasy/SF stories with transformation themes, email me \o\
   \o\ for a copy of the Transformation Stories List.                       \o\
From: cconstantine@galaxy.gov.bc.ca
Newsgroups: comp.sys.mac.programmer
Subject: One routine works, the other doesnt, WHY??
Date: 29 Dec 92 12:19:33 -0800
Organization: BC Systems Corporation

Could someone please explain to me why the following routine gets compile time
errors under MPW C 3.2.4:

curDev = GetMainDevice();
pixDepth = GetPixelDepth( curDev );                             
if ( pixDepth <> 8 )                                            
    DeathAlert( errNot8Bit );


but the following routine both compiles _AND_ works????!!!!!!

                curDev = GetMainDevice();
		pixDepth = GetPixelDepth( curDev );
		switch ( pixDepth )
		{
			case 8:
				break;
			default:
				DeathAlert( errNot8Bit );
				break;
		}

I've mentioned the first one before, but now that I've _fixed_ the problem, I'm
really confused as to why I got the errors in the first place.  I would prefere
to use only a few lines of code (4)  as opposed to many (almost 10 including
begin and end brackets)!!!!!


Thanks for any help.


Carl B. Constantine
CCONSTANTINE@galaxy.gov.bc.ca
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.sys.mac.programmer
Subject: MPW slow to open files
Date: 28 Dec 92 13:34:50 +1300
Organization: University of Waikato, Hamilton, New Zealand

In one of my projects, I've got a subfolder with about 600 source files in it.
MPW commands like Backup and Make take a while to execute, but I can understand
that.

What I can't understand is why opening one of those source files in the MPW
editor should take so long. Basic file system operations don't seem any slower:
if I use the Duplicate command to make a copy of one of those files in the
same folder, it works at a similar speed to what it would in any other
folder. If I ask MPW to open a nonexistent file in that folder, it returns
an error message pretty smartly. But if I try to open a file that *does*
exist (using either the Open command or selecting the file name and hitting
command-D), my hard disk churns away for several seconds before the window
opens.

What I'd like to know is: what's MPW doing that's taking so long? It's not
doing something stupid like scanning every file in that folder, is it?

By the way, this happens with both MPW versions 3.3a14 and 3.3a16. I must
admit I haven't checked to see if it happens with MPW 3.2.3. The machine
is a Mac LC, being my home machine where I do most of my hacking (I realize
the effect might be less noticeable on a faster machine :-)). Also I have
my file system cache set down to 32K, because I'm prone to crash my machine
a lot and I'm a little scared of disk corruption--in case that's a factor.

Lawrence D'Oliveiro                       fone: +64-7-856-2889
Computer Services Dept                     fax: +64-7-838-4066
University of Waikato            electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
It's a weather-free day in Wellington.        -- Jeremy Coney
From: yjc@po.cwru.edu (Jerome 'TofuSoft' Chan)
Newsgroups: comp.sys.mac.programmer
Subject: Re: How do I find a hole in the DeskTop?!
Followup-To: comp.sys.mac.programmer
Date: 28 Dec 1992 19:19:03 GMT
Organization: The Tofu Society of Singapore
Distribution: world
NNTP-Posting-Host: yjc-slip.dialin.cwru.edu

In article <1992Dec28.024044.3652@panix.com>, rmah@panix.com (Robert Mah)
wrote:

> GREAT IDEA.  I'm gonna use it too, if you don't mind.


Please go ahead and use it.

Maybe someone could put up a window behind such a hole and do neat little
animations, like maybe a cartoon of the talking moose playing chess with
the dogcow. :)

---
The Evil Tofu
Newsgroups: comp.sys.mac.programmer
From: gwatts@fnalo.fnal.gov
Subject: Re: 'Threads' package question
Organization: Fermi National Accelerator Lab
Date: Sun, 3 Jan 1993 02:25:22 GMT
X-Posted-From: fnalo.fnal.gov
NNTP-Posting-Host: sol.ctr.columbia.edu

In article <1993Jan2.184916.18378@cc.umontreal.ca>, casgrain@ERE.UMontreal.CA (Casgrain Philippe) writes:
> I would like to know what _is_ exactly the 'Threads' INIT (extension).
> I believe it allows multi-threading programming.  Is this related to multi-
> tasking?  Is there any sample code that I can look at to program (Pascal,
> preferably)?  Is there any documentation available? (I have access to ETO).

Check out develop issue 6 and 7 -- they have the articles describing the
threads package.  You can get them off the develop cd, or in the apple ftp
site, under dts/doc/develop.  It has some sample code there as well as the
text of the article.

I suppose you could call it multitasking -- in the same sense that multifinder
is multitasking.  It allows several execution paths (threads) to be active at
once in your application.  It is a nice package, though I think that apple
has stopped working on it.  I've heard that something like this
will be included in a future system, but I don't remember where I heard that...

	Cheers,
		Gordon