HDTenEightyP/NetNews huggingface dataset:
From: absurd@apple.apple.com (Tim Dierks, software saboteur)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Distinguishing FrontClicks?
Date: 3 Jan 93 22:40:14 GMT
Followup-To: comp.sys.mac.programmer
Organization: MacDTS Marauders

In article <BzpzH1.8tD@unx.sas.com>, Michael Hecht
<Michael_Hecht@mac.sas.com> wrote:
> 
> Hello!
> 
> I turned on the getFrontClicks bit in my SIZE resource, because it makes
> sense for my application. However, I don't want *all* parts of the window
> to respond to layer-changing clicks. How can I distinguish a click that
> changes my layer from other clicks?

A technique that's worked for me is to compare the 'when' fields of the
click and the resume event; if the mouseDown has a time before the
resume event, then it's probably this click that caused you to be switched.
(The exception would be if the user had posted several events, which got
queued up because [Get|Wait]NextEvent wasn't being called often enough;
for example, if I have an INIT which switches layers when I hit a hot key
installed, and I type the hot key, then click, the click won't have caused
the switch, but it will seem like it had.)

Specifically, when you get a resume, remember the value in the "when"
field;
when you get the first mouseDown after the resume, check its when; if it
was posted before the resume (or at the same time), consider it to be the
click that brought you forward.

Official sounding warning: this is only a side effect of the way the
process manager works now.  Don't count on it continuing to work this way,
it's not a documented feature.  If you want to use it, make sure you're
willing to accept the ways in which it might break (unreliable detection
of clicks which bring the layer to the front).

Enjoy,
Tim Dierks
MacDTS, but I speak for myself and my Albert Einstein doll
Newsgroups: comp.sys.mac.programmer
From: wondertr@fraser.sfu.ca (wondertree learning center)
Subject: Re: MAC development environments
Keywords: MAC development environments
Organization: Simon Fraser University, Burnaby, B.C., Canada
Date: Tue, 29 Dec 1992 08:14:08 GMT


I would like to thank everyone who responded to my query re 
Mac Development Environment....

I must apologize for not specifying the C/C++ language ...

I guess what I really want (from the replies I got) is a Think C++
that has the features of Think Pascal.... hmm....
Hey.... Symantec.... are you listening????

Thanks again

TED


Newsgroups: comp.sys.mac.programmer
From: davek@netcom.com (David Kramer)
Subject: Re: Detecting File Launch
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Tue, 22 Dec 1992 01:51:10 GMT

ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:

>In article <1992Dec21.040009.26063@mcs.drexel.edu>, udsugar@mcs.drexel.edu (David Sugar) writes:
>> I am looking for a way to detect how a file was launched.  For
>> instance I need to know if an application was launched by
>> being double clicked or weather it was started at startup
>> time because it was in the StartUp Items folder.  (I realize
>> that I can check to see if the application is in the Startup
>> Items folder but I need to see if it was user launched.)

>This check won't gain you anything anyway, since you might have been launched
>via an alias in the Startup Items folder.

>> The reason for this is because if the Application was double-
>> clicked I would like to bring up a preferences screen or
>> something like that, but if the Application was run because
>> it is startup time and the Application is in the Startup
>> Items folder I would like for the Application to do whatever
>> then quit without any user interaction.
>>
>> Any ideas??

>I don't think what you want is possible in general. I don't think the Finder
>does any different processing for Startup Items than it does for a user
>open request.

>Alternative: have a special document type. If you launch the application by
>opening this, then you don't get the preferences dialog. Put a document of
>this type (or an alias to it) in the Startup Items folder, instead of the
>application itself.

>Or split the application into two parts: a faceless part that gets launched
>at startup time, and a front end that the user has to open explicitly to
>configure the faceless part.

>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

Splitting your program works very well.  The best way I can think of is to
make a cdev/appe combo.  Trashman 4.x uses this meathod, and I have found
it very convenient to use.  When the Macintosh starts up, the appe in the
extensions loads up into the background.  Then, if the user wants to
change anything, they just open up the cdev and change the prefs.  The
prefs might be put into a file in the preferences folder from which the
appe could read and the cdev could read and write.  Or use apple events. 
Get Trashman 4.x so you can see what I'm talking about. (I'm not sure how
the Trashman cdev and teh Trashman appe communicate, be it a pref file or
whatever.)

David Kramer 
Newsgroups: comp.sys.mac.programmer
From: gs@statlab.uni-heidelberg.de (G. Sawitzki)
Subject: Re: Think Pascal->C conversion -- advice?
Followup-To: comp.sys.mac.programmer
Organization: StatLab Heidelberg
Date: Wed, 23 Dec 92 10:10:25 GMT

In article <1992Dec18.021125.23146@afterlife.ncsc.mil>,
mssmith@afterlife.ncsc.mil (M. Scott Smith) wrote:
>    I'm in the process of converting a large, complex program written with
> Think Pascal to Think C.  

P2c may save you some work. P2c is a converter from from Pascal to C.

You can find p2c as stand-alone application as well as an MPW tool on our
server
  statlab.uni-heidelberg.de [129.206.113.100]

Current limitations:
 Object Pascal not supported
 Conditional compilation not supported
So you may need to spend some preparatory work to get the standard units
from MPW (Types.p, Memory.p,...) and remove the conditional statements.
 G. Sawitzki
From: d88-jwa@hemul.nada.kth.se (Jon Wtte)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Sound Manager bug
Date: 23 Dec 92 11:13:00 GMT
Organization: Royal Institute of Technology, Stockholm, Sweden

In <1992Dec22.212335.26752@cs.uoregon.edu> mkelly@mystix.cs.uoregon.edu (Michael A. Kelly) writes:


>What's the status of the Sound Manager bug?  You know, the one where the
>sound will just cut out on certain machines?  Has anyone managed to convince
>Mr. Reekes that the bug actually exists?

No.

I sent him my program, it works on his IIfx and Quadra 700 and
maybe he tried a 145 too.
It now works on my Quadra 950 (since I upgraded from a 900)

It didn't work on my Quadra 900, and it doesn't work on my PowerBook
170.

Cheers,

						/ h+

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  "It was, in fact, cool as all get-out.  Fortunately it was a little
   too late (historically speaking) to be groovy."
                     -- Dennis Pelton
Newsgroups: comp.sys.mac.programmer
From: kevr@is.morgan.com (Kevin Reilly)
Subject: Learning to program w/ MacIILC
Organization: Morgan Stanley & Company
Distribution: usa
Date: Sat, 2 Jan 1993 17:03:33 GMT


My neighbor has recently got the "I want to find out how
these things work" bug. He owns a Mac IILC? Since I am
from the PC world (forgive me for intruding! :)) I could
not set a path for him to follow.
I assumed there must be some cheap C-compilers and intro
books out there. Could someone out there please give me a hand with
this and I will forward relevant info to him.
Also he has never programmed before!

Thanks in advance!!!

Kevin M. Reilly
From: misc042@cantua.canterbury.ac.nz (Mr M J Miller)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Detecting File Launch
Date: 21 Dec 92 21:42:35 GMT
Organization: University of Canterbury, Christchurch, New Zealand.
X-Newsreader: TIN [version 1.1 PL6]

David Sugar (udsugar@mcs.drexel.edu) wrote:
> I am looking for a way to detect how a file was launched.  For 
> instance I need to know if an application was launched by 
> being double clicked or weather it was started at startup
> time because it was in the StartUp Items folder.  (I realize
> that I can check to see if the application is in the Startup
> Items folder but I need to see if it was user launched.)

How about sampling tickcount? -It should be fairly low if the 
application has been startup launched (less than a minute anyway).

;-} MJM.
misc042@cantua.canterbury.ac.nz
(I am no way employed by,
	or a spokesperson of,
		the University of Canterbury).
From: jmunkki@vipunen.hut.fi (Juri Munkki)
Newsgroups: comp.sys.mac.programmer
Subject: Re: QuickDraw
Date: 1 Jan 93 04:21:43 GMT
Reply-To: jmunkki@vipunen.hut.fi (Juri Munkki)
Organization: Helsinki University of Technology

In article <1992Dec31.012947.10273@wuecl.wustl.edu> ppc1@cec2.wustl.edu (Peter Pui Tak Chiu) writes:
>hi...
>plane while i am showing a frame and then when the new frame is done, i set
>the viewing rectangle to the newly drawn frame and draw the next frame
>somewhere else.
>

Things do not work this way in QuickDraw. The way you do something like this
in QuickDraw is by creating an offscreen bitmap, pixmap or gworld. Instead
of thinking in terms of one huge page, think of various small pieces of paper,
some of which are visible (the screen bitmap[s]/pixmap[s]) and some of which
you can only copy to other places (like the screen).

-- 
  Juri Munkki					       Windsurf: fast sailing
 jmunkki@hut.fi					      Macintosh: fast software
Newsgroups: comp.sys.mac.programmer
From: ingemar@isy.liu.se (Ingemar Ragnemalm)
Subject: Re: Sound Manager bug
Organization: Dept of EE, University of Linkoping
Date: 23 Dec 92 10:15:57 GMT

mkelly@mystix.cs.uoregon.edu (Michael A. Kelly) writes:


>k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
>>Is this the one that only happens (as far as I know) on the IIsi?

>It happens to me on my IIcx.  I usually have a Rocket in the cx, which makes
>things worse (I think there's a bug in the Rocket), but even without the
>Rocket the sound cuts out occasionally.

I think there are two different problems, one bug in the Sound Manager that
occurs on several (all?) Macs. Many programs, especially games (which often
have to keep a channel open for a long time) have this problem. In my own
games, I have experienced it on several different Macs. It could be that
too many sounds are queued, so the channel is full, but why is there no
error? (Using bufferCmd.)

The other, IIsi-specific problem, must be a hardware error. The cure to it
is to raise the sound volume for a moment.

Any deeper insights in these problems would be appriciated.

-- 
Ingemar Ragnemalm
Dept. of Electrical Engineering	     ...!uunet!mcvax!enea!rainier!ingemar
                  ..
University of Linkoping, Sweden	     ingemar@isy.liu.se
Newsgroups: comp.sys.mac.programmer
From: js@Turing.ORG (Jon Schull)
Subject: Twiddler to Mac
Organization: The Turing Project, Public Access Internet Host
Distribution: comp.sys.mac.programmer
Date: Mon, 28 Dec 1992 15:13:02 GMT

I just acquired a Twiddler-the mouse that types- for my PC-compatible.
The device gets 5 volt power from the keyboard port but does its controlling
through the PC's serial port.

My question is, anyone know how to control a mac through the serial port
rather than the usual keyboard/mouse connections?

-
From: d88-jwa@hemul.nada.kth.se (Jon Wtte)
Newsgroups: comp.sys.mac.programmer
Subject: Re: TCL, Another Question...
Date: 22 Dec 92 21:01:45 GMT
Organization: Royal Institute of Technology, Stockholm, Sweden

In <1992Dec22.184643.29251@fsl.noaa.gov> urban@yoda.fsl.noaa.gov (Art Urban) writes:

>However, I would like to display a "startup" window while the application
>loads, and preps. My question is: where is the best place to implement this
>behavior?

I wouldn't use a TCL window, since they require the Desktop to be
initialized, etc etc. Instead I would put up a "normal" window
after calling EventAvail three times, and draw my picture in that,
RIGHT after initting the toolbox. Then I would override Run so
it first removed the window (or waited until N ticks had passed
by calling EventAvail and checking the event.when field) and
then called CApplication :: Run.

Or I would patch DoAppleEvent so that an oapp AppleEvent sent a
cmdAbout instead of opening a new window :-)

Cheers,

								/ h+

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
   The word "politics" is derived from the word "poly", meaning
   "many", and the word "ticks", meaning "blood sucking parasites".
                     -- Larry Hardiman
Newsgroups: comp.sys.mac.programmer
From: Brad Koehn <koehn@macc.wisc.edu>
Subject: Re: Think C debugger problem
X-Xxdate: Sat, 2 Jan 93 08:22:57 GMT
Organization: Data Transformations, Inc.
X-Useragent: Nuntius v1.1.1d11
Date: Sat, 2 Jan 93 08:23:45 GMT

Think C debugger problem

In article <C03K7J.DxJ@rice.edu> Robert Schmunk, schmunk@spacsun.rice.edu
writes:
>An application I have been working on (Think C 4 on a Mac LC II, sys 7)
>recently developed an inclination to unexpectedly quit and go back to the
>finder. I had just made a large number of changes so reversing the
changes
>was out of the question and so I just decided to turn on Think C's
>debugger option. Unhappily, when the application fires up, I get the
>two debugger windows and everything freezes (reboot necessary). The
>debugger menu bar is blank and the only clue to the problem is a 
>"Bus error" message in the listing window. 

My guess is that you may be running out of memory. Have you tried
checking to see if your application is using up most of your memory,
because the debugger requires its own 250K RAM partition.

Brad Koehn
Data Transformations, Inc.
From: aleskine@cs.hut.fi (Arto Leskinen)
Newsgroups: comp.sys.mac.programmer
Subject: script manager
Date: 23 Dec 92 22:03:52 GMT
Distribution: comp.sys.mac.programmer
Organization: Helsinki University of Technology, Finland

Hello! Do you happened to have some dokumentation of GetFormatOrder and 
StyledLineBreak functions.

Another problem I am having is that I seem to get random crashes. Is there
a way to find out when value of variable changes without running step by
step and hoping to find out. I have MacsBug and Think C 5.04

pascal void GetFormatOrder(FormatOrderPtr ordering,short firstFormat,short lastFormat,
    Boolean lineRight,Ptr rlDirProc,Ptr dirParam)
    = {0x2F3C,0x8012,0xFFFC,0xA8B5}; 

Defined in Script.h

So this is what I know about it.

I also would like to know what kind of table I should give to 
pascal void NMeasureJust(Ptr textPtr,long textLength,Fixed slop,Ptr charLocs,
    JustStyleCode styleRunPosition,Point numer,Point denom)
    = {0x2F3C,0x801A,0x0034,0xA8B5}; 

Defined in Script.h

It says Ptr charLocs, and Ptr should point to table. I suppose size char is
not big enough.

Arto Leskinen
aleskine@cs.hut.fi
Xref: sparky comp.sys.mac.programmer:20577 comp.sys.mac.oop.misc:152
From: bpb9204@tamsun.tamu.edu (Brent Burton)
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.oop.misc
Subject: Re: David Betz and Bob Language
Date: 3 Jan 1993 20:42:29 -0600
Organization: Texas A&M Univ., Inc.
NNTP-Posting-Host: tamsun.tamu.edu

edw@distant.uucp writes:
|
|It's written in K&R C, and does wierd things with function arguments. For
|instance, it'll define a function like this:
|
|do_expr()
|{ [...] }
|
|and then call it with arguments! You don't do things like this in ANSI C,

Welcome to the weird, wild, wooly world of RealWorld Programming!
I'm not trying to belittle you in any way, but I've just seen *so many*
programs with code like this -- and they still work.  Amazing.

As you delve deeper into the worlds of other hacker's code, you'll see
more and more weird things (like passing 12 arguments to a function just
because the programmer didn't use variable argument lists - ala GNU Bison -
and then only using 3 in common usage.  You'd think these guys never heard
of a parameter block or data structures before, but I digress.)

|3. Knows what the hell is happening with the stuff I described above.

Well, the stuff, for the most part, will work, but I can't put too much
confidence into code that uses anticonventions like your above example.

The trick to getting it to compile with Think C 5 is to turn off some
of the Think C extensions, mainly the prototype inferencing and strict
type checking.  I've found this to work with most codes.

However, if the code just doesn't run, you better plan to spend some
serious time editing the code to make it ANSI-compliant.  This is
tedious.

Good luck, and your ideas sound good.  Keep us all posted.

-Brent
-- 
+-------------------------+
| Brent Burton    N5VMG   |    
| bpb9204@tamsun.tamu.edu |  
+-------------------------+
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Detecting File Launch
Date: 22 Dec 92 11:26:40 +1300
Organization: University of Waikato, Hamilton, New Zealand

In article <1992Dec21.040009.26063@mcs.drexel.edu>, udsugar@mcs.drexel.edu (David Sugar) writes:
> I am looking for a way to detect how a file was launched.  For
> instance I need to know if an application was launched by
> being double clicked or weather it was started at startup
> time because it was in the StartUp Items folder.  (I realize
> that I can check to see if the application is in the Startup
> Items folder but I need to see if it was user launched.)

This check won't gain you anything anyway, since you might have been launched
via an alias in the Startup Items folder.

> The reason for this is because if the Application was double-
> clicked I would like to bring up a preferences screen or
> something like that, but if the Application was run because
> it is startup time and the Application is in the Startup
> Items folder I would like for the Application to do whatever
> then quit without any user interaction.
>
> Any ideas??

I don't think what you want is possible in general. I don't think the Finder
does any different processing for Startup Items than it does for a user
open request.

Alternative: have a special document type. If you launch the application by
opening this, then you don't get the preferences dialog. Put a document of
this type (or an alias to it) in the Startup Items folder, instead of the
application itself.

Or split the application into two parts: a faceless part that gets launched
at startup time, and a front end that the user has to open explicitly to
configure the faceless part.

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
Newsgroups: comp.sys.mac.programmer
From: mike@pmafire.inel.gov (Mike Caldwell)
Date: Wed, 23 Dec 92 18:39:36 GMT
Organization: WINCO
Subject: Fortran Compiler for MAC
Distribution: na

We are going to move some VMS-compatible FORTRAN over to MAC and we
need a FORTAN compiler.  Does anyone have any recommendations?
Anything that we should definitely avoid?

Mike Caldwell
-- 
Mike Caldwell (mike@pmafire.inel.gov or mike@inel.gov)
Paths: ...uunet!pmafire!mike
From: tal691@huxley.anu.edu.au (Tonio Loewald)
Newsgroups: comp.sys.mac.programmer
Subject: Re: How can I write AfterDark routines?
Date: 1 Jan 93 14:52:58 GMT
Organization: Australian National University
NNTP-Posting-Host: 150.203.2.12

rsvanc00@nx39.mik.uky.edu (Randolph S. Vance) writes:

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

After Dark comes with an API. Shame on you! If you had a legal copy
you would know this!

To use the API, you need MPW Pascal or C or THINK Pascal or C.

Tonio Loewald

-- 
Tonio Loewald | tal691@huxley.anu.edu.au | Life is short. Be nice.
"You can lie/You can cry/For all the good it'll do you, you can
die/But when it's done/And the police come/And they lay you down
for dead/Just remember what I said" (Paul Simon-not the senator)
Newsgroups: comp.sys.mac.programmer
From: siegel@world.std.com (Rich Siegel)
Subject: Re: "DisposePtr" routine in THINK Pascal
Organization: GCC Technologies
Date: Fri, 1 Jan 1993 22:25:56 GMT

In article <1993Jan1.191132.13938@fcom.cc.utah.edu> Dmitry Boldyrev <dmitry@chemistry.chem.utah.edu> writes:

> DisposePtr(Ptr(AppPtr));	#debugger info: address of AppPtr is
>0001D23A2 (OK)
>end.			#debugger info: address of AppPtr is 0001D23A2 ?
>		
>I used standard THINK Pascal debugger..
>
>Why, after calling *DisposePtr* my address is  0001D23A2 ?
>It can't be! The address must be 000000000 here !!!!
>What does it mean ? *DisposePtr* do nothing here? or smth else ?
>I'm always care about "memory" in my programs! 
>Therefore I CAN'T CONTINUE MY PROJECT! Please, if anyone know what I'm
>doing wrong, help!

DisposePtr doesn't zero the actual pointer itself; it just releases the
block of memory that the pointer pointed to. You don't have to worry;
the memory actually did get freed.

R.


-- 
-----------------------------------------------------------------------
Rich Siegel                              Internet: siegel@world.std.com
Senior Software Engineer
GCC Technologies
Newsgroups: comp.sys.mac.programmer
From: positron@engin.umich.edu (Jonathan Scott Haas)
Subject: Re: Short Question
Date: Thu, 31 Dec 92 20:05:57 EST
Organization: University of Michigan Engineering, Ann Arbor

In article <1i0549INNik6@agate.berkeley.edu> robohen@ocf.berkeley.edu (Henry Robertson) writes:
>I am learning how to use Think C.  I bought a book, "Programming Quickdraw"
>yesterday, and they assume you have Inside Macintosh already.  I can follow\
>along what Quickdraw is saying, but the one question is, what do I have
>to #include at the beginning in order to use quickdraw commands?

I got that same book... it's pretty good. In any case, my version of Think
seems to automatically include all of the Mac #includes... at least, I
haven't had to manually insert any of them. If yours doesn't, try 
#include <Quickdraw.h>.

-- 
__/\__  Jonathan S. Haas         | Jake liked his women the way he liked
\    /  University of Michigan   | his kiwi fruit: sweet yet tart, firm-
/_  _\  positron@engin.umich.edu | fleshed yet yielding to the touch, and
  \/                             | covered with short brown fuzzy hair.
Newsgroups: comp.sys.mac.programmer
From: bwilliam@iat.holonet.net (Bill Williams)
Subject: Re: SCSI Disk Driver
Organization: HoloNet National Internet Access BBS: 510-704-1058/modem
Distribution: comp
Date: Wed, 23 Dec 1992 06:23:22 GMT

Complete source code to a much earlier version of Apollyonics SCSI driver
(as used in many products including the software distributed by Club Mac
and APS with their hard disks) was distributed on the pair of CD-ROMS
issued by the Ann Arbor Michigan MacTechnics user group. The disks were
called "M3" 1990 anthology set. The source is in the Apollyonics folder
and is very good, well commented assembly.

Hope that helps


Bill Williams
Organization: Bar-Ilan University Computing Center, Israel
Date: Sat, 26 Dec 1992 18:55:47 IST
From: Yair Elharrar <X68442@BARILVM.BITNET>
Newsgroups: comp.sys.mac.programmer
Subject:    MacDraw file format

Hello; I want to create a small utility that will read in certain data and
output a MacDraw file; I'm looking for some help on how MacDraw files are
built, including basic objects like lines and text.
Any help will be greatly appreciated.

Please respond by e-mail to X68442@BARILVM.BITNET or to
elharrar@bimacs.cs.biu.ac.il (132.70.1.1).

          Thanks in advance,
             Yair Elharrar
             Bar-Ilan University
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.comm