HDTenEightyP/NetNews huggingface dataset:
From: mkelly@mystix.cs.uoregon.edu (Michael A. Kelly)
Subject: C.S.M.P. Digest V1 #185 Available
Followup-To: poster
Organization: University of Oregon Computer and Information Sciences Dept.
Date: Thu, 15 Oct 1992 13:38:45 GMT


C.S.M.P. Digest             Thu, 15 Oct 92       Volume 1 : Issue 185

Today's Topics:

	Adding Balloon help
	Problems in Macintosh Programming Secrets
	Animated Cursor
	Q: GrayRgn + Menu bar region
	Need small example of playing a sound in THINK C.
	INIT Idea/Request
	UseResFile() problems with CTB Tools
	Drawing Icons in Modal Dialogs?
	CTB undocumented routines and Think Libs



The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.

The digest is a collection of article threads from the internet newsgroup
comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
regularly and want an archive of the discussions.  If you don't know what a
newsgroup is, you probably don't have access to it.  Ask your systems
administrator(s) for details.  (This means you can't post questions to the
digest.)

Each issue of the digest contains one or more sets of articles (called
threads), with each set corresponding to a 'discussion' of a particular
subject.  The articles are not edited; all articles included in this digest
are in their original posted form (as received by our news server at
cs.uoregon.edu).  Article threads are not added to the digest until the last
article added to the thread is at least one month old (this is to ensure that
the thread is dead before adding it to the digest).  Article threads that
consist of only one message are generally not included in the digest.

The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
[128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
file /pub/mac/csmp-digest/README before downloading any files.  The most
recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
archive has a mail server; send a message with the text '$MACarch help' (no
quotes) to LISTSERV@ricevm1.rice.edu for more information.

The digest is also available via email.  Just send a note saying that you
want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
automatically receive each new issue as it is created.  Sorry, back issues
are not available through the mailing list.

Send administrative mail to mkelly@cs.uoregon.edu.


-- 
_____________________________________________________________________________
Michael A. Kelly                                         University of Oregon
mkelly@cs.uoregon.edu                             Computer Science Department
_____________________________________________________________________________
From: chuck@gte.com (Chuck Hoffman)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Novice Needs help with input!!!!!!
Date: 15 Oct 92 19:29:06 GMT
Followup-To: comp.sys.mac.programmer
Organization: GTE Laboratories

In article <1992Oct9.133022.1@vmsclst1.sc.csupomona.edu>,
mgeorgy@vmsclst1.sc.csupomona.edu wrote:
> 
> Hello, I need a little help on obtaining input from the screen.  Can someone
> please explain to me the options available to me and how I can implement them. 
> The type of input required is at most a one word command, at which point my
> program will do one thing or another.

If you're just getting started with Mac programming, take a look at the
chapter in Inside Macintosh, Volume 1, about the Dialog Manager.  You can
do what you have described with a "Modal Dialog."  Mac programmers try to
avoid the use of modal dialogs unless absolutely necessary (see the chapter
on the user interface guidelines) but this is a good enough (band-aid)
temporary solution for someone just starting out.

Inside Macintosh is published by Addison Wesley, and currently is being
rewritten and reorganized.  I'm referring to the old edition.

> I am not yet proficient enough to use
> menus in my program other wise I would.  Maybe if someone has a little time
> they can explain the use of menus????

Whoops!  This is the first of many, many Catch-22's in Mac programming. 
The Menu Manager must be initialized (and a menu bar set up) first, before
you can use the Dialog Manager.  It always seems like when you want to do
something, you need to have done something else first.  The real problem
here is that the general structure of a Mac program needs to be explained
before the Menu Manager can be explained.  It takes more than "a little
time."  There is a little bit of menu code (in Pascal) in I.M. volume 1 at
the beginning of the book.  There is also a chapter on the Menu Manager in
volume 1.

Also, you may find Chapter 5 of "Macintosh C Programming Primer, Volume 1,
Second Edition" helpful.  It's from Addison Wesley, and is by Dave Mark and
Cartwright Reed (ISBN 0-201-60838-3, $26.95 in U.S.A.).

As a final choice, I have a 2-3 day course and can come teach this stuff at
the beginner level to small groups, on a not for profit basis.  If you want
to set something up, give me a call.


Chuck Hoffman
chuck@gte.com
GTE Laboratories, Waltham, Massachusetts, USA
(617) 466-2131
=====================================
I'm not sure why we're here, but I am sure that while we're here we're
supposed to help each other.
=====================================
From: mgeorgy@clstcs
Newsgroups: comp.sys.mac.programmer
Subject: Novice need help with ERROR!!!!!!!!!!!
Date: 16 Oct 92 21:13:04 GMT
Nntp-Posting-User: mgeorgy

Hello, I have a problem that I was hoping someone could help me with!!!  I
write compile/link/run my program almost succesfully.  When I run it the
computer is trying to tell me something in a Dialog box the problem is that the
Dialog box is not within my screen but to the left and above my view, all I can
see is the OK button.  I then click on the button, and it says something else,
I click OK again and the program quits.  How can I find out what the system is
telling me???

Please reply by posting directly to the system as my mail system is not
working.

Thank You Very much,
Matt Georgy
California State Polytechnic State University, Pomona  -- Computer Science
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+When It Absolutely, Positively, Has To Be Taken Out Overnight!!!+
+                                                                +
                              -- Team Stealth      +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Newsgroups: comp.sys.mac.programmer
From: Ted Lowery <tbl@rock.concert.net>
Subject: Re: problem with my dialog filter
Organization: MacSolutions
X-Useragent: Nuntius v1.1
Date: Thu, 8 Oct 1992 16:46:57 GMT

Try this...

void	FlashButton(int ButtonID);
/*  just flash the button, visual only  */
void	FlashButton(int ButtonID)
{
	Rect		itemRect;
	long		ticksLater;
	
	itemRect = GetDRect (ButtonID);
	InsetRect (&itemRect, 1, 1);
	InvertRoundRect (&itemRect, 8, 8);
	ticksLater = TickCount() + 10;			/* wait a sixth second...I don't know */
	while (TickCount() < ticksLater) ;		/* if that is standard, I just
guessed  */
	InvertRoundRect (&itemRect, 8, 8);
}



pascal Boolean charFilter(DialogPtr theDialog,EventRecord *theEvent,short
*itemHit);
pascal Boolean charFilter(DialogPtr theDialog,EventRecord *theEvent,short
*itemHit)
{
	Str255	theText;
	if (theEvent->what != keyDown) return(FALSE);  /* only looking for key
downs */
	
	switch ((theEvent->message) & charCodeMask) {
		case 0x0D:
		case 0x03:
			*itemHit = OKButton;					/* basically tell ModalDialog we handled the
*/
			FlashButton(OKButton);			/*  keydown, but now there is an itemHit that
*/
			return(TRUE);										 /* than ModalDialog gets to handle  */
			break;

		default:
			break;
		}
}

Hope this helps.

Ted
tbl@rock.concert.net
Newsgroups: comp.sys.mac.programmer
From: ksand@apple.com (Kent Sandvik)
Subject: Re: C++ (was Amateur Programming?)
Date: Fri, 16 Oct 1992 02:39:11 GMT
Organization: Apple
Followup-To: comp.sys.mac.programmer

> In article <01050166.g2b4jm@joebloe.maple-shade.nj.us>,
> joseph@joebloe.maple-shade.nj.us (Joseph Nathan Hall) wrote:

> > Personally, I'd prefer a kinder, gentler language--full-featured,
> > yes, and close to the metal (so long as speed is an issue), but
> > one that doesn't require that you learn by shooting yourself in the
> > foot repeatedly.

Dylan.

Kent
-------------------
Kent Sandvik (UUCP: ....!apple!ksand; INTERNET: ksand@apple.com)
DISCLAIMER: Private activities on the Net.
From: seanmcd@ac.dal.ca
Newsgroups: comp.sys.mac.programmer
Subject: Direct screen draw: how much faster than Quickdraw?
Date: 7 Oct 92 19:19:47 GMT
Organization: Dalhousie University, Halifax, Nova Scotia, Canada

I've been programming a first person perspective fantasy role playing game for
about a year and a half now as a personal project. The view window is 200 x
338 and is b&w on a classic. right now I'm doing lots of offscreen drawing
with layers to simulate depth and to ease animation. It takes about 20-30 ticks
to draw a new screen image (BTW, my view is similar to Wizardry/Bard's Tale,
but with more movement and items on the screen). I'm using all kosher drawing
techniques right now, i.e., Quickdraw. What, in rough terms, are the speed
advantages of using direct draw instead of Copybits/copyMask? I'm not
displeased with the speed right now, but it's going to get more complicated,
so I'd like to know whether this would make a significant difference.

Thanks! e-mail, or post here if you think it's interested enough...
Organization: Stanford Linear Accelerator Center
Date: Monday, 12 Oct 1992 17:20:13 PST
From: Nobukazu Toge <TOGE@SLACVM.SLAC.STANFORD.EDU>
Newsgroups: comp.sys.mac.programmer
Subject: Re: Menu Mgr Qustion
 <keith-121092055403@kip-55.taligent.com>

Keith -

Thank you, thank you for the info!  I also noticed that the clip region of
window manager port, during _MenuSelect time, apparently holds the region
where menu drawing is taking place... i.e. MenuRect of the latest menu. Its
rgnBBox is set  to (0,0,0,0) or (-32767...32768) when no menu is displayed.
So,that looks to me like a good one to use, with all the warning signs and
disclaimers and so on.

> How dirty do you want to get?

I'm curious to see how dirty I can get  ;-)

- Nobu Toge (ex-SLAC, now-KEK)

#include <StandardDisclaimers.h>
#include <IfIGetBurnedItsNotKeithsFault.h>
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@byse.nada.kth.se (Jon Wtte)
Subject: Re: Gestalt, Think C and System 6
Originator: d88-jwa@byse.nada.kth.se
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Thu, 15 Oct 1992 10:06:00 GMT

> webb@cm.deakin.OZ.AU (Geoff Webb) writes:

   the calls
	   Gestalt(gestaltFindFolderAttr, &gestalt_response);
	   Gestalt(gestaltNotificationMgrAttr, &gestalt_response);
	   Gestalt(gestaltHelpMgrAttr, &gestalt_response);

   all fail to alter the value of gestalt_response when run on System 6.

You're not checking the Gestalt return code. If Gestalt
returns anything but 0, you should ignore the reply and
assume the feature is not there.

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Suedoise (not french speaking) --

  "On a clear disc, you can seek forever."
From: st@starlab.UUCP (Stefan Taxhet)
Newsgroups: comp.sys.mac.programmer
Subject: help: out of memory detection
Keywords: memory MPW
Date: 15 Oct 92 21:32:17 GMT
Organization: Star Division GmbH, D-W-2000 Hamburg, Germany

Hi,
we are programming the Macintosh Toolbox with MPW C++ (not with MacApp)
and we have the following problems:
1.) To detect "out of memory" conditions, we use the standard
    C++ mechanism new_handler, which should be called when out of memory
	conditions occurs.
2.) We purge some of or code segments.
    To detect any "out of memory" conditions when reloading segments,
	we have implemented a grow-zone function, which should be called,
	when a segment can not be loaded.

The problem is:
The callbacks are only called sometimes, when out of memory conditions occur.
When the callback is not called, the operating system hangs up.

Question:
Is there anything to pay attention for, when using this mechanism.
We read "Inside Macintosh" Memory and Processes and did exactly,
what they suggested.

Thanks in Advance
	Stefan Taxhet

-- 
Stefan Taxhet                                    FAX:   +49 40 23646 550
STAR Division GmbH                               Phone: +49 40 23646 952
Sachsenfeld 4                                    uucp: ...!unido!starlab!st
D-W-2000 Hamburg 1                               domain: st@starlab.uucp
From: perm@csd.uu.se (Per Mildner)
Newsgroups: comp.sys.mac.programmer
Subject: Drag&Drop App to launch multiple docs together WHERE?
Date: 12 Oct 92 11:38:34
Organization: Computing Science Dept.,Uppsala University, Sweden
Distribution: world
NNTP-Posting-Host: groucho.csd.uu.se

I saw a note about a drag and drop app with which you could group
several documents and an application for launching. I cannot find it
anywhere. I looked att sumex but didn't find it. Does anybody recognize
this description? Yes I tried various archives as well as WAIS (most
Mac related WAIS servers seems to be down btw).
Thanks in advance,
--
Per Mildner			perm@CSD.UU.SE
Computing Science Dept.		tel: +46 18181049
Uppsala University, Sweden	fax: +46 18521270
Newsgroups: comp.sys.mac.programmer
From: roessli@sc2a.unige.ch
Subject: Parsing a text file (TP 4.01, MacApp 2.01)
Organization: University of Geneva, Switzerland
Date: Sun, 11 Oct 1992 14:55:10 GMT

Hello,
	could anyone give me a piece of advice for resolving the
following problem:

I need to implement an 'import' procedure in an statistical analysis 
program that i'm currently developing. The data to import will be 
reals for a text file (mac and DOS), and most often arranged in rectangular 
or triangular matrixes.

The problem is the following: I'm using THINK Pascal 4.01 and MacApp 2.01
as programing environment and librairies. I planned to use THINK's built
in procedures (OldFileName,..) to identify the file to import, and then
just reset() it, and read unitl the EOF into some data structure, then
save it into the program's own format. I know that 'OldFileName' isn't
the best of ways to access a file, as it specifies the whole pathname,
hence making no provision for the case where 2 volumes would have the same
name (!), but I'm in some kind of a hurry (no excuse, i know..).

Anyway, the problem is that if I access the file that way, there's no way
I can close it properly, MacApp having a method called Close (TApplication)
that closes all documents .. no way I can call THINK's Close(f) ..
I'd use TApplication.ChooseDocument(), to get the AppFile info on the file
to import, read the data, and stuff it into a fresh document (TApplication.
OpenNew()), if I managed to figure out how one parses a text file for 
numbers that can vary in length, structure, organisation, etc. ? 

I'm at a loose end here ..

Thanks for reading, and for any eventual hints/snippets, cheers,

:david
--
David C. Roessli
Dept. of Anthopology and Ecology of the University of Geneva, Switzerland
Phone: +41(22) 343-6930 Fax: +41(22) 300-0351 Email: roessli@sc2a.unige.ch
From: serickso@ub.d.umn.edu (Scott Erickson)
Newsgroups: comp.sys.mac.programmer
Subject: Help compiling NetHack for Mac
Date: 7 Oct 1992 08:41:25 -0500
Organization: University of Conformist Thought
Distribution: usa
Reply-To: serickso@ub.d.umn.edu (Scott Erickson)
NNTP-Posting-Host: ub.d.umn.edu


Help!

I am trying to compile NetHack 3.0j for the Mac.  I can compile and run
makedefs with no problems.  I can also compile spec_lev, but whenever I run,
it tells me it is working on castle.des and then it quits and I get a message
from multifinder saying that the application unexpectedly quit.  If I am not
running multifinder, I get a system error message.  Any ideas?  I am using
THINK C 5.0, far as I know, NetHack was set for THINK C 4.0.  Are there any
differences that would cause this?  

If there is anything you think I should look for, please let me know.  As it
is, there is too much code and I am not very proficient with C.  I am using
NetHack as way of trying to improve my C proficiency.

Your help will be appreciated.  Thank you.

--

I have sold all of my dreams and I am too morally bankrupt to buy them back.

serickso@ub.d.umn.edu                                         Scott Erickson
-- 

I have sold all of my dreams and I am too morally bankrupt to buy them back.

serickso@ub.d.umn.edu                                         Scott Erickson
From: potts@itl.itd.umich.edu (Paul Potts)
Newsgroups: comp.sys.mac.programmer
Subject: Re: C++ (was Amateur Programming?)
Date: 16 Oct 1992 17:46:11 GMT
Organization: Instructional Technology Laboratory, University of Michigan
NNTP-Posting-Host: helen.oit.itd.umich.edu

In article <ksand-151092193947@wintermute.apple.com> ksand@apple.com (Kent Sandvik) writes:
>Dylan.

Great, now if only I could get it to work... has anyone gotten one of the
scheme implementations to run? I pulled down a scheme from stanford archive
and it bombed terribly. Also, all the menus were in french...

-- 
"Everything I say is a lie." <--- potts@oit.itd.umich.edu ---> that's me!
"C++ will make your programming simpler, more efficient, and more fun!"
"What good is a computerized nose?" - Lou Reed
Newsgroups: comp.sys.mac.programmer
From: jmajor@well.sf.ca.us (John Major)
Subject: AFP calls - headers and/or code?
Organization: Whole Earth 'Lectronic Link
Date: Thu, 15 Oct 1992 18:58:23 GMT



?


Hello!

Apple has provided AFPCommand (in the .XPP driver) as a
way to pass commands to AFP, but has not documented or
provided headers or code to build the parameter blocks which
must be passed along. Presumably they are encouraging us to
use file-system calls, but poor me, I must in this situation
go through AFP. At any rate - have you, kind soul, already
grappled with this problem, typed in the definitions in
Inside AppleTalk (v 2), preferably in C, and, perhaps even
built some higher level code to do the dirty work? If so,
*please* call or email me directly (I'm not reading usenet
every day), and I will be eternally grateful!

Thanks -
John Major
jmajor@well.sf.ca.us
work: 508/535-2513
home: 508/487-3148
From: cnc@cacus.bt.co.uk (Colin Crist)
Newsgroups: comp.sys.mac.programmer
Subject: Mac Development
Date: 13 Oct 92 13:14:10 GMT
Reply-To: cnc@cacus.bt.co.uk
Organization: British Telecom

Apologies if this is a FAQ ... 

My develepment background is in X/OpenWindows, Interviews etc and I'd like
to start on some work for Macs. My questions are......

1. What is the best environment, I'd prefer C++ for what I've in mind.

2. What toolkits are avilable  ?

3. Can anyone point me in the direction of some good reference material ?

4. Whats a good platform - Mac II 8/120, CD-ROM ?

I'm looking for general directions to explore and evaluate....

Thanks in advance.

Colin

-------------------------------------------------------------------------
Colin Crist, cnc@muppet.bt.co.uk	I'm not an employee, merely a 
				 	contractor, so all my mistakes
					are my own and everything I say
					is my own view....
					
Newsgroups: comp.sys.mac.programmer
From: keith@taligent.com (Keith Rollin)
Subject: Re: MPW Question
Followup-To: comp.sys.mac.programmer
Organization: Taligent
Date: Thu, 15 Oct 1992 23:22:20 GMT

In article <1992Oct15.135831.26391@alias.com>, Reid Ellis <rae@Alias.com>
wrote:
> 
> My preference is for in-place unmangling.  A bit more verbose, but I
> like it [\x is options-x, \. is option-. etc etc]
> 
>     AddMenu Misc 'Unmangle/U' \d
>         'Begin; \d
>             target "{active}"; \d
>             set str `cat "\6"`; \d
>             set unstr "`unmangle {str}`"; \d
>             if "{unstr}" =~ /Unmangled symbol: (\x)\r1/; \d
>                 set unstr "{\r1}"; \d
>             end; \d
>             replace "\6" "{unstr}"; \d
>             rotateWindows; \d
>         End > Dev:Null \. Dev:Null'
> 
> The only thing about this is that it *requires* that at least 2
> windows be open.  Ergle.

Well, then we can do better...

     AddMenu Misc 'Unmangle/U' \d
         'Begin; \d
             set str `catenate "{Active}.\6"`; \d
             set unstr "`UnmangleTool {str}`"; \d
             if "{unstr}" =~ /Unmangled symbol: (\x)\r1/; \d
                 set unstr "{\r1}"; \d
             end; \d
             replace "\6" "{unstr}" "{Active}" ; \d
         End \w Dev:Null'

I'll leave it to Bruce Hoult to reduce this to one statement.   :-)

-----
Keith Rollin
Phantom Programmer
Taligent, Inc.
Newsgroups: comp.sys.mac.programmer
From: us277614@mmm.serc.3m.com (Dave T. Berquist)
Subject: Re: More GWorld/animation ?'s
Organization: 3M Company
Date: Wed, 14 Oct 92 13:18:37 GMT

In article <1992Oct13.194203.25145@afterlife.ncsc.mil> mssmith@afterlife.ncsc.mil (M. Scott Smith) writes:
>My quest to become fluent in the art of doing flicker-free animation on
>the Mac continues..
>
>A few questions:
>
>- I made a test program which had three color images; their pict files
>  are maybe 10k each (pretty small).  I believe I set up a GWorld the
>  size of the picture (in pixels, also pretty small).  With 3 images and
>  3 GWorlds, it seemed fine, but when I added a fourth I suddenly needed
>  to increase the memory allocated to the program, by quite a bit (much
>  more than 11k; maybe 200 or so.)
>
>  I may have possibly set the GWorld to a larger size than I just said
>  I did; but, irregardless, is a GWorld generally set up for each
>  picture that is a frame of an animation sequence?  How much memory
>  do these GWorlds require, and what kinds of things do I need to take
>  into consideration?
>

In answer to this question the PICT files are probably stored packed
(run length encoding) which makes them fairly small.  When GWorlds are
allocated in memory, the memory for the pixels is un-packed.  Therefore
the memory needed for the pixels is approximately width*height*pixelSize
.  pixelSize might be 1 byte, 2 bytes or 4 bytes.  Therefore one can see
that the size of the GWorld in memory may be much larger than the size
of the PICT in memory.

Dave Berquist
3M Company
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: Bug in Mac ROMs
Organization: Kalamazoo College
Date: Wed, 14 Oct 1992 01:06:49 GMT

michael@otago.ac.nz writes:
>
>I have just found this little gem being executed in the ROM of my IIsi...
>
>408177A6:  MOVE.L A0,-(A7)
>           _LoadResource
>           _HLock
>
>Unless I'm hallucinating again, this is a bug. It relies on A0 being preserved
>across the _LoadResource call, something it has no right to do.

At the top of my IM I, page 120, it says "Assembly-language note:
LoadResource preserves _all_ registers."

Unless of course _I'm_ hallucinating.  :-)
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "To flame someone on an open forum is, to me, the height of insensitivity."
   - P.J. Plauger
Newsgroups: comp.sys.mac.programmer