HDTenEightyP/NetNews huggingface dataset:
From: tjohnson@joule.elee.calpoly.edu (Todd Johnson)
Newsgroups: comp.sys.mac.programmer
Subject: idle events (System 6)
Summary: How do I get regular idle events?
Date: 4 Jan 93 22:53:32 GMT
Distribution: usa
Organization: California Polytechnic State University, San Luis Obispo


  I'm a novice Mac programmer working on my first application. I've
searched through the FAQ sheet and some of the archives, but I have
yet find the answer to my problem. Here goes:

  I'm using Think C (version 5) on a Mac running System 7. My 
application works fine in this environment, but I need to get it
to work under System 6 as well. (Sadly, not my choice.) Basically,
I want to flash something in a window at regular intervals (paint
it black, then white, etc.) Currently, I set gSleepTime to 0 and
do my drawing during the idle event (Dawdle() message sent to the
window's director). This allows the user to interrupt the program
by selecting a menu item.

  The problem is that System 6 does not handle events the same
way System 7 does, but I don't know specifically what the differ-
ences are. My question is how to send myself messages at regular
intervals while enabling the user to type and click.

  Any ideas or pointers to reference material would be greatly
appreciated, inasmuch as I will soon become bald.


Todd Johnson              tjohnson@joule.elee.calpoly.edu
Newsgroups: comp.sys.mac.programmer
From: jimlynch@netcom.com (Jim Lynch)
Subject: Re: GNU and MPW Shell?
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
Date: Sun, 10 Jan 1993 05:37:30 GMT

In article <C0JoIH.JuE@news.rich.bnr.ca> holiday@bnr.ca writes:
>There was a copy of the MPW 3.2.2 shell on ftp.apple.com, but it's only legal
>for those who've already forked out for MPW --- it's a bug fix upgrade.  You'll
>need to pay APDA $150 for the MPW shell by itself.  On the other hand, without
>MPW C, you may not be able to build gcc stuff for MPW --- Think C won't work.

Once someone ports the stand-alone gcc to the mac, you will _no longer_ need
to pay APDA $150 for MPW and however-much for their C compiler.

People like _us_ will be able to have an inexpensive C, C++, Objective-C, I
think they're working on Fortran and Pascal. That's FIVE languages for the
price of NONE. Add to this that we could compile the rest of GNU and have a
UNIX-alike.


Xref: sparky comp.sys.mac.programmer:21154 comp.os.ms-windows.programmer.tools:1968
From: tzs@carson.u.washington.edu (Tim Smith)
Newsgroups: comp.sys.mac.programmer,comp.os.ms-windows.programmer.tools
Subject: Re: Stallman and friends
Date: 11 Jan 93 04:48:25 GMT
Article-I.D.: shelley.1iqu6pINNrpd
Organization: University of Washington School of Law, Class of '95
NNTP-Posting-Host: carson.u.washington.edu

mellon@ncd.com (Ted Lemon) writes:
>RMS has reason to believe otherwise.   Ask him about Macsyma sometime.
>Macsyma was developed at the MIT AI lab using government funding and
>was commonly held by the programmers there to be in the public domain.
>Then Symbolics negotiated a deal with MIT wherein MIT transferred the
>copyright to Symbolics.

If the code was in the public domain, there was no copyright to transfer.
MIT could not prevent anyone from doing anything they wanted to do with
the code -- that's how public domain works.  In particular, they could
not take it out of public domain (although they could make changes, and
those changes would not be public domain).

--Tim Smith
From: noah@apple.com (Noah Price)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Uniquely identifying a Mac? How?
Date: 4 Jan 93 18:23:50 GMT
Followup-To: comp.sys.mac.programmer
Organization: (not the opinions of) Apple Computer, Inc.

In article <1458@shrike.com>, flash@austin.lockheed.com (James W. Melton)
wrote:
> In article <1hb3o8INNt5h@calvin.NYU.EDU> roy@mchip00.med.nyu.edu (Roy Smith) writes:
> >	Any box that comes with a built-in ethernet port has the moral
> >equivalent of a machine-readable serial number -- the ethernet 6-byte
> >hardware address.
> 
> I have bad news for you: The ethernet address is set in software.
> The high-order portion of the address is supposed to reflect the
> manufacturer, and the low-order portion is supposed to be machine
> unique (a serial number), but this is not accomplished in hardware
> NECESSARILY.

I know "any box" wasn't limited to a Macintosh, but all the Macs with
on-board ethernet have a unique address in a PROM.

noah

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
noah@apple.com                                 Macintosh Hardware Design
...!{sun,decwrl}!apple!noah   (not the opinions of) Apple Computer, Inc.
Newsgroups: comp.sys.mac.programmer
From: bskendig@netcom.com (Brian Kendig)
Subject: Re: moof?
Organization: Starfleet Headquarters: San Francisco
Date: Fri, 8 Jan 1993 17:46:40 GMT

positron@quip.eecs.umich.edu (Jonathan Haas) writes:
>d88-jwa@dront.nada.kth.se (Jon Wtte) writes:
>>
>>He's dead, guys, dead. He died with a re-structuring of DTS
>>last year. Sorry to break the news.
>
>They killed Clarus the Dogcow? Nooooo! :)

Bah, these rumors of Clarus's death are as silly as those rumors of
Elvis's death.  The dogcow is still alive, and she visits me
sometimes.  I brought her to MacWorld Expo yesterday, and she'll be
there again with me tomorrow, so keep your eyes open.

-- 
_/_/_/  Brian Kendig                             Je ne suis fait comme aucun
/_/_/  bskendig@netcom.com                de ceux que j'ai vus; j'ose croire
_/_/                            n'etre fait comme aucun de ceux qui existent.
  /  Nolite te bastardes     Si je ne vaux pas mieux, au moins je suis autre.
 /    carborundorum.                                             -- Rousseau
Newsgroups: comp.sys.mac.programmer,comp.os.ms-windows.programmer.tools,comp.windows.ms.programmer
From: johnston@me.udel.edu (Bill Johnston)
Subject: Re: Stallman and friends
Organization: University of Delaware
Date: Thu, 7 Jan 1993 01:07:50 GMT

On the subject of Stallman as "kook":

It may or may not be true that Stallman has at times advocated 
allegedly "kooky" ideas.  I won't recount the examples, because
I have no personal knowledge as to whether they are true, nor
do I particularly care.  They don't affect me or you any more
than the fact that Bill Clinton has a cat.  My dog is worried
a bit, but I know better than to confuse my judgement of the 
president's personal views with his public actions.

What matters is not Stallman's personal political views, but 
rather the practices of the organization he heads.  The FSF
is an organization that publishes software.  It does so under
a unique license whose terms are controversial.  

It is NOT a political action committee, and it's activities 
are not directed to promoting the passage of laws that would
mandate any of Stallman's personal utopian goals.  Stallman
may still choose to write and lecture on "kooky" subjects,
but his actions as head of a public organization - FSF -
are constrained by its charter and in particular by one
aspect of its business practice, namely, its licensing policy.

If an individual disagrees with the terms of the FSF's 
"General Public License" (GPL), well, no one is forced 
to use their software or to assist them in writing it.

The unique feature of the GPL is that Stallman too is 
limited by its terms -  the rights and restrictions 
associated with a work published under the GPL affect 
everyone equally.  Put differently, if you really buy 
into the "kook" theory and worry about what Stallman 
will do next - don't.  If you can live with the terms
of the GPL now, feel free to use, improve, and distribute
GPL'd software - once applied, the license can't be changed 
in any fundamental way to something "kooky" - not even by
Stallman.

In no way does Stallman "threaten" anyone's livelihood
by virtue of his political views.  If he is successful
at completing a GPL'd alternative to the unix operating
system, companies who sell proprietary implementations
will be affected in the same way that they would by any
competitor who releases an alternative product.  If users
like GNU (Gnu's Not Unix) under its "kooky" license better 
than their current proprietary operating system, it will
succeed.  This kind of "threat" is just pure competitive 
capitalism, not politics.  Companies who do it better and 
cheaper usually win.
-- 
-- Bill Johnston (johnston@me.udel.edu)
-- 38 Chambers Street; Newark, DE 19711; (302)368-1949
From: mssmith@afterlife.ncsc.mil (M. Scott Smith)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Think C bug? [sprintf]
Date: 11 Jan 93 19:45:25 GMT
Organization: The Great Beyond

Hi..  I'm the original poster who asked about potential problems with sprintf.

I received several replies which I'm grateful for.  I apologize for not
providing many details about the specific problem(s) I was having -- it was
not clear to me whether the problems I was having was related to sprintf or
not, and I simply wanted to see if there was a well-known bug in sprintf,
that I hadn't heard about.  I wasn't proposing that there might be a bug.
(I was also under a time deadline.)  Anyway, thanks to those who responded,
and sorry for not being very verbose.

It sounds like some people have had no problems with sprintf, while others
have.  I wasn't sure if it was commonly used by Mac C programmers; are there
Toolbox calls (non-ANSI) that Mac pros tend to use instead?

Does sprintf only operate with arrays of characters, or will it be happy with
types like Str255?  Or do I have to coerce Str255's to make them work?  I
think some of my problems were traced back to that.  At the same time, I wasn't
sure what the problem was, because something would compile fine one way but
not the next.  (It seems if Think C saw me passing a Str255 to sprintf it
was happy about it; but if later in the program I passed a "real" string to
it, then it suddenly saw problems with one of the calls..  I guess it's checking
types to make sure I'm being consistent.)

Is sprintf the best way to capture the functionality of Pascal's concat?

Thanks,

M. Scott Smith
  (mssmith@afterlife.ncsc.mil)
Newsgroups: comp.sys.mac.programmer
From: mark@cheers.jsc.nasa.gov (Mark Manning)
Subject: Re: A Difference of Pointers
Organization: NASA
Date: Tue, 5 Jan 1993 15:15:35 GMT

I would like to thank everyone who wrote to me with their solutions
to this problem.  Thanks! :)

The solution to the problem was sent by Sean J. Crist
<kurisuto@chopin.udel.edu>.  To whom I will be eternally grateful
for clearing up my confusion on this.  Thanks Sean!

Solution:

What I didn't know MPW Pascal could do was to perform typecasting
(like you can do in C).  This is what needed to be done in order
to correctly extract the needed information.  Sean wrote:

Mac Pascal supports a very important feature called typecasting.  You can
typecast any type to any other type (within certain restrictions- you
can't typecast an integer to a handle, for example).  I'll illustrate with
code samples like yours:

>   SetPort( theDialog );
>   GetDItem (theDialog, theItem, theType, theHandle, theRect);
>   theControl := @theHandle;
>   theValue := GetCtlValue( theControl );

(Just as an aside- I'm pretty sure you don't have to do this SetPort
before you do GetDItem, but this isn't real important.)

Your code should read:

   SetPort( theDialog );
   GetDItem (theDialog, theItem, theType, theHandle, theRect);
   theValue := GetCtlValue(ControlHandle(theHandle));

The important line is the third one.  theHandle is type Handle, but you
can make it into a ControlHandle by referring to it as
ControlHandle(theHandle).

This is also how you allocate memory for your own kinds of handles.  For
example, if you have the following declarations...

   type
      MyStructure = record
          AString : Str255;
          AnInteger : Integer;
          ABoolean : Boolean;
        end;
      MyPointer = MyStructure^;
      MyHandle = MyPointer^;

..then you would allocate a new MyHandle as follows:

   var
      ExampleMyHandle : MyHandle;
      ExampleHandle : Handle;
   begin
      ExampleHandle := NewHandle(SizeOf(MyStructure));
      ExampleMyHandle := MyHandle(ExampleHandle);
      ExampleMyHandle^^.AString := 'This is a string!'
      etc.

If you like, you can leave out the ExampleHandle and collapse the first
two lines after 'begin' into one:

     ExampleMyHandle := MyHandle(NewHandle(SizeOf(MyStructure)));

---------------------->

And it works in both cases, without glitches, and without causing
other problems.  I hope this helps others who are struggling with
their own problems of learning to write programs.  Heaven knows - 
I need all the help >I< can get! ;)

Newsgroups: comp.sys.mac.programmer
From: soc1070                         
Subject: Re: Default buttons in dialogs
News-Software: VAX/VMS VNEWS 1.41    
Organization: University of Minnesota CIS
Date: Mon, 11 Jan 1993 15:40:00 GMT

In article <01050023.n60ojt@chinchilla.cars.com>, chinchilla!niel@cars.com writes...
> 
>In article <1993Jan7.153419.3711@tdb.uu.se> (comp.sys.mac.programmer), bredell@tdb.uu.se (Mats Bredell) writes:
>>BoBolicious (bowman@reed.edu) wrote:
>>: In article <880840m.29.726366713@axe.acadiau.ca> 880840m@axe.acadiau.ca (MICHAEL ALEXANDER MCKAY) writes:
>>: >Whenever I make a dialog box with ResEdit, my "OK" buttons, which are always
>>: >the number 1 button, fail to show up in my app with the heavy outline around 
>>: >them. What am I doing wrong?
>>: 

>Somewhere I found a CDEF that automatically puts the border around
>any item whose name ends with an "@".  Very useful.  I can't remember
>where I found it, but it's just called "Default".
> 
>Niel M. Bornstein                 

I found defaultCDEF 1.2 on plains.nodak.edu just today. Its kind of
deep in the dir structure, but not difficult to find. (Lets see...
I think it was pub/mac/pub/programming/src). The info file says the
CDEF is 32-bit clean and color QD compatable.

The plains archive is not as current as most other places, but its
pretty good all the same. Plus, you can usually get in during the
day, unlike sumex.

Question:

While on plains, there was a file called circularWDEF for creating
non-rectangular windows. This file was the readme file from a
program called Windows Demo. Does anyone have a copy of this program
or has anyone updated the source provided in the readme? I would
be real interested to see how this looks/works.

------
Tim Harincar				A skunk is better company than
soc1070@vx.cis.umn.edu			someone who prides themselves on
 					being frank. -Lazerus Long
From: mellon@ncd.com (Ted Lemon)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Why the Piracy? Here's why...
Date: 12 Jan 93 20:13:59 GMT
Organization: Network Computing Devices, Inc.
In-reply-to: phaedrus@halcyon.com's message of 10 Jan 93 18:49:56 GMT


>It sounds to me like rich philanthropists are going to be the only
>people able to be full-time artists, scientists, programmers, etc.
>under your scheme.

I'm not at all convinced that that's true, but even if it is, isn't it
a laudable goal to be trying to create a world in which *everybody*
can be a rich philanthropist if they want?

			       _MelloN_
--
mellon@ncd.com						uunet!lupine!mellon
Member of the League for Programming Freedom.   To find out how software
patents may cost you your right to program, contact lpf@uunet.uu.net
Newsgroups: comp.sys.mac.programmer,comp.os.ms-windows.programmer.tools,comp.windows.ms.programmer
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Subject: Re: Stallman and friends
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Wed, 6 Jan 1993 14:23:39 GMT

In <1993Jan5.213038.2088@netcom.com> jimlynch@netcom.com (Jim Lynch) writes:

>How fo you feel about software patents? If you're threatened by ideas that
>the FSF espouse, such as my right to write anything I damn well please, I
>hereby threaten you. How do you like me now?

Well, I have mixed feelings.

1) If I cook up something on my own and code it, I should be free
   from liability
2) If someone diassembles that something and uses the algorithm,
   he should not be free from liability

Maybe a limited kind of patent that lasts for say 5 years, like
they have in the medical business (only there it's 2 years)

And software lends itself to licensing readily; you could imagine
a global ftp site with patented algorithm example implementations
for study & use, coupled with the address to obtain licensing...

Cheers,

								/ h+
-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --

   Cookie Jar: Vanilla Yoghurt with Crushed Oreos.
Xref: sparky comp.sys.mac.programmer:21201 comp.os.ms-windows.programmer.tools:1983
From: kim@Software.Mitel.COM (Kim Letkeman)
Newsgroups: comp.sys.mac.programmer,comp.os.ms-windows.programmer.tools
Subject: Re: Stallman and friends
Date: 11 Jan 93 17:45:05 GMT
Organization: MITEL Public Switching, Kanata, Ontario, Canada

In article <1993Jan7.042203.26183@netcom.com> jimlynch@netcom.com (Jim Lynch) writes:

| Hey! Look, man: all compiler writers are kooks. Stallman just
| happens to be giving his kookyness away.

Take a look at some more of his writings. I think you'll find that he
charges for his consulting services in order to help finance the FSF
(and perhaps the LPF as well - I'm not certain.)

He doesn't actually give anything away, he just gets others to pay for
it indirectly. A truly socialist approach. He is also able to suck
programmers into accepting a lower standard of living. I am definitely
impressed with that part .... :-)

Before you staunchly defend RMS, you should ensure that you are
behaving in accordance with his ultimate goals. One of these is to
reduce the salaries of programmers. Ask for a pay cut. Don't be a
hypocrite.
--
Kim Letkeman	kim@Software.Mitel.COM
Newsgroups: comp.sys.mac.programmer
From: peter@cujo.curtin.edu.au (Peter N Lewis)
Subject: Re: Alert Help
Followup-To: comp.sys.mac.programmer
Organization: NCRPDA, Curtin University
Date: Wed, 13 Jan 1993 01:42:37 GMT

In article <1993Jan12.002334.330@physc1.byu.edu>, seth@physc1.byu.edu
wrote:
> 
> DANG IT! Not more than two minutes after I posted my question I went back and
> started looking at my alert again and noticed that the static text that was
> getting the rectangle around it was item #1. So, I tried something I hadn't 
> tried yet - I tried renumbering the items. I made my button item #1, and, you
> guessed it, this time the buttin was surrounded by the "default" rectangle. 
> You
> can tell I haven't got much experience with this yet... Well, it certainly is
> embarassing to post a question on the net and find your own answer within a
> couple of minutes afterwards....

Don't worry about it - there would be very few programmers who haven't at
one time or another had their alert's come up with the a huge rounded
rectangle around their static text items, of course once its got you once
you just smile and say "ooops" :-)

> BUT, this does bring up a couple of new questions. Within the last few weeks I
> seem to remember a guy asking why he couldn't get a default button surrounded
> autonatically by the "default" round-corner rectangle. Someone said that this
> was not autonatic, and discussed ways of doing this. On my machine with THINK
> Pascal it DOES seem to be automatic. Also, why didn't this show up in ResEdit?
> Is this a "feature" of THINK Pascal? It must be, as I created some alerts in
> THINK C before, and I don't recall anything being surrounded by the "default"
> rectangle then.

It is automatic for Alerts, except that the rounded rect isn't updated when
the screen is redrawn (as far as I'm concerned, thats Apple's problem, so I
don't put any code in to do it myself).

For Dialog's, its not automatic.  You can do it in one of three ways:

Use Default CDEF.
Use the System 7 only SetDialogDefaultItem call.
Write your own user item that draws the outline.

I use the latter (I posted Pascal code to do it here recently).  Many
people have had lots of success with Default, and presumably the System 7
call works easily enough if you can depend on System 7.

Have fun,
   Peter.

_______________________________________________________________________
Peter N Lewis <peter@cujo.curtin.edu.au>             Ph: +61 9 368 2055
Newsgroups: comp.sys.mac.programmer
Subject: YACC again
From: neilsend@physc1.byu.edu
Date: 7 Jan 93 20:46:25 -0700
Distribution: world
Organization: Brigham Young University

Thanks for those who gave me the suggestions on a YACC compilier for
the MAC.  I really can't afford the commercial compilier and when
I found BISON I discovered it ran under MPW and not Think-C.  I
found a file called POSIX that contains various libraries used to
convert the GNU stuff.  I then found the GNU BISON and am planning
to try and compile the thing.  I am sure that it will not be as
easy as all that.  So I am wondering if there is a BISON that 
runs with Think-C or something equivalent.  Alternative suggestions
also accepted.

Clark Goble
goblec@theory.byu.edu
From: bowman@reed.edu (BoBolicious)
Newsgroups: comp.sys.mac.programmer
Subject: Re: SetLineWidth PicComment
Date: 5 Jan 93 20:08:51 GMT
Article-I.D.: reed.1993Jan5.200851.29259
Organization: Reed College, Portland, OR

In article <1993Jan5.145142.9081@nntp.hut.fi> s33986s@kaira.hut.fi (Jarkko Kallio) writes:
>Thanks to your help I found SetLineWidth PicComment, Technical
>Note #175, to draw thin lines on LaserWriter. But I use Macintosh
>Common Lisp 2.0 and even if it supports most Mac traps and records
>it does not know the SetLineWidth constant. SetLineWidth is an integer 
>(Inside Macintosh I-189):
>
>Procedure PicComment (kind, dataSize :INTEGER; dataHandle :handle);
>(kind should be SetLineWidth. dataSize and dataHandle: see TN#175.)

TN #91 has a complete listing of opcode.  Anyhow, SetLineWidth is:

*SetLineWidth   182      4     Point         Set fractional line widths

The asterisk means, "LaserWriter driver 3.0 or later".

cheers,
bobo              In seeking the unattainable,
bowman@reed.edu            simplicity only gets in the way.
Eternal nothingness is fine if you happen to be dressed for it. - Woody
Newsgroups: comp.sys.mac.programmer
From: siegel@world.std.com (Rich Siegel)
Subject: BBEdit & THINK Reference (was Re: Think Ref 2.0)
Organization: GCC Technologies
Date: Fri, 8 Jan 1993 15:02:08 GMT

In article <PHILS.93Jan8083854@chaos.cs.brandeis.edu> phils@chaos.cs.brandeis.edu (Phil Shapiro) writes:
>
>TR 2.0 supports two AppleEvents which allow third-party programs to
>look up templates for toolbox calls (a la Apple's 411) and to bring up
>TR with a particular entry frontmost.

(plug mode!)

BBEdit 2.2, the currently shipping version, detects the existence of
THINK Reference 2.0 on your hard disk, and puts a THINK Reference menu
in your menu bar that you can use to look up Toolbox symbols or get
function templates from THINK Reference 2.0.

You can find BBEdit 2.2 for anonymous FTP from world.std.com (it's
in ~ftp/pub/bbedit) and from most other popular archive sites and
information services.

(end plug mode)

R.


-- 
-----------------------------------------------------------------------
Rich Siegel                              Internet: siegel@world.std.com
Senior Software Engineer
GCC Technologies