HDTenEightyP/NetNews huggingface dataset:
From: kevinb@engr.LaTech.edu (Kevin P. Brunner)
Subject: Help for a new programmer (CDEF's & Debuging Resource Code)
Summary: Would like to see some code for a home-grown Slider/Scrollbar Control 
Keywords: CDEF,Debug,Controls,Resource 
Organization: Louisiana Tech University
X-Newsreader: TIN [version 1.1 PL8]
Date: Wed, 6 Jan 1993 04:55:39 GMT

  I've been working on the mac for the last 6 months, recently converted from
ibm p.c.  I'm getting my feet wet with controls and resources.  I have been 
able to create small apps with standard mac stuff, but would like to design
my own controls.  Inside Macintosh does a lot for stating generalities...
"you need this, and one of these, and, oh!, one of these too..." but no 
specific examples in this case.

  So I've tried creating a CDEF which responds only to the draw message and
returns zero (0) for everything else.  It responds, but draws something
completely different than what the code says.  The code inverts a block
of pixels in a window (it works when called from the "main" block of code,
but not when the resource is compiled seperately -- I get a rounded box!)

  Has anyone written custom controls?  If so, do you mind sharing a portion
of your code and development technique?  Also, any help on using Think C
to debug resources would be appreciated.  I have most of the Inside Mac's and
both Programming the Macintosh's (vol 1 and 2)  I have looked elsewhere but
have found nothing with coding examples or techniques.  Book or Article 
references would be appreciated as well.

Thanks in advance!

kevinb@engr.latech.edu
From: athos@apple.com (Rick Eames)
Newsgroups: comp.sys.mac.programmer
Subject: Re: TCL, MultiFinder, and Progress Dialogs
Date: 12 Jan 93 17:47:21 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple Computer, Inc.

In article <1993Jan11.215603.26274@kth.se>, d88-jwa@byse.nada.kth.se (Jon
Wtte) wrote:

> Actually, this is a bad thing to do to a TCL app; for instance
> AppleEvents would be lost because they are ALWAYS delivered
> regardless of event mask.
> 
> Instead, I usually put up a movable, modal dialog with the bar
> etc, and when I need to give idle time, I do:
> 
> 	gSleepTime = 0 ;
> 	gApplication -> Process1Event ( ) ;
> 
> If you can set up an Idle chore to do the idling, you could
> even have your dialog be the supervisor of the chore and have
> BeginDialog and EndDialog handle dialog ending.
> 
> So what does this do? Well, you can't call DoModalDialog if you
> cannot push the thing you're doing into a chore; you'll have
> to mimic the behaviour in your idle call. What remains is to
> handle DoCommand ( cmdCancel ) by overriding it in the
> CDLOGDirector.
> 

The problem with this method is that your damned cursor ends up resetting
to a pointer each time you Process1Event() so you have to override that too
to ensure that your nice spinning cursor works.

############################################################################
Rick Eames                         Internet:      athos@apple.com
Apple Computer, Inc.               CompuServe:    76666,2114
My Opionions are my own.           AmericaOnline: EamesR
"The Lord prefers common-looking people. That is why he makes so many of
them."  - Lincoln

"But you know what?  There's another point that I'd like to make: it's very
possible that Adolf Hitler kept a very nice check book.  You know?  I mean,
and that's fine."  -- Barbara Boxer, Bill Press Show, KFI, 10/24/92
############################################################################
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Subject: Re: Help for a new programmer (CDEF's & Debuging Resource Code)
Keywords: CDEF,Debug,Controls,Resource 
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Wed, 6 Jan 1993 14:56:05 GMT

> How to debug CDEF in Think C

Well, you could try and create a CDEF that's only 6 bytes,
load it in, make it contain a JMP instruction and the
address of a function in your application, and flush the
cache (after locking the resource)

Something like:

typedef struct cdef {

	unsigned short jmp ;
	short * ( addr ) ( ) ;

} cdefStub ;


pascal short
MyRealCDEF ( whatever )
{
	Do the stuff
}


/* DO this before creating any controls */

	cdefStub stub ;
	Handle h = GetReosurce ( 'CDEF' , 4711 ) ;

	stub . jmp = 0x4000 ; /* Have to look this up, JMP Immediate */
	stub . addr = MyRealCDEF ;

	HLockHi ( h ) ; /* Top of heap to avoid fragmentation */

	* ( cdefStub * ) * h = stub ;

	if ( TrapAvailable ( _HWTrap ) ) {


		FlushInstructionCache ( ) ;
	}


Now anything going to CDEF 4711 in your program will go to
the function MyRealCDEF, and you can use the source debugger
on it, and reference globals even! Cool!


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

   Cookie Jar: Vanilla Yoghurt with Crushed Oreos.
From: speth@cats.ucsc.edu (James Gustave)
Newsgroups: comp.sys.mac.programmer
Subject: Help needed with GetFInfo()
Date: 6 Jan 1993 20:54:43 GMT
Organization: University of California; Santa Cruz
NNTP-Posting-Host: am.ucsc.edu


I'm using GetFInfo to get the TYPE and CREATOR codes of a file, but I'm having
problems.  I'm passing the file's FSSpec to my function which looks like this:

void MyFunction(FSSpec inputFile)
{
	short	inFileRefNum;
	FInfo	finderInfo;
	char	*fileType	= (char *) &finderInfo.fdType;
	char	*fileCreator	= (char *) &finderInfo.fdCreator;
	
	GetFInfo(inputFile.name, inputFile.vRefNum, &finderInfo);
	....
}

I'm then using fileType and fileCreator.  Like this, I get garbage, but if I
change the second argument to GetFInfo to 0 instead of inputFile.vRefNum, and
the file I'm using is in the default directory, it works fine.  What am I
missing??  The vRefNum from the FSSpec should be OK, right?  Argh.

Thanks.

-- 
________________________________________________________________________________
james speth          finger for pgp 2.0 public-key           speth@cats.ucsc.edu
From: bowman@reed.edu (BoBolicious)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Where does BinHex live?
Date: 7 Jan 93 21:42:24 GMT
Article-I.D.: reed.1993Jan7.214224.2764
Organization: Reed College, Portland, OR

In article <7JAN199314501289@vx.cis.umn.edu> soc1070                          writes:
>In article <1ii0ddINN6hr@shelley.u.washington.edu>, chuckb@stein.u.washington.edu (Charles Bass) writes...
>>If someone can tell me where BinHex lives I would be grateful.

>The best utility I've found for encoding/decoding BinHex files (.hqx) is
>Stuffit 1.5.1. I tried about two or three BinHex-specific utilities
>(BinHex 4.0, etc), and none are as reliable as stuffit. The commands
>are under the OTHER menu.

Far better, IMO, is "Stuffit Expander" if you just want to debinhex stuff.
It knows many formats (binhex,stuffit,compactor, others) & is smart &
configurable for *very easy* drag'n'drop unstuffing.  It's on all the
major ftp sites except ftp.apple.com (I think...).

chairs,
bobo              In seeking the unattainable,
bowman@reed.edu            simplicity only gets in the way.
"On Monday, numbers floated everywhere, and the world was full of 
approximations."  -- Spencer Heinz, _The Oregonian_, 1/5/93
Newsgroups: comp.sys.mac.programmer
From: ray@netcom.com (Ray Fischer)
Subject: Why error #87 (can't load WDEF)?
Organization: Netcom. San Jose, California
Distribution: na
Date: Tue, 5 Jan 1993 21:47:02 GMT

Alright folks.  This one has been bugging me and I'm looking for
inspiration from the (other) wizards on the net.

Here's the deal.

I'm working on the large program that has this interesting problem.
At times it is doing something that causes the Finder to generate
error messages saying that it can't load the WDEF when windows are
opened and closed (system error #87).  This happens when the program
has been switched to the background and I'm using the Finder in the
foreground.  When I stop the program, the problem goes away.

So, the question is, what sort of things will cause this behavior?
The system heap and Finder heap both have enough free memory, and
there are plenty of free FCB's.  Apple's documentation on error codes
is rather, well, shall we say "sparse"?

Clues/hints/suggestions cheerfully accepted, email or news.  Thanks in
advance.

Later ...

-- 
Ray Fischer                   "Convictions are more dangerous enemies of truth
ray@netcom.com                 than lies."  -- Friedrich Nietszsche
Newsgroups: comp.sys.mac.programmer,comp.os.ms-windows.programmer.tools,comp.os.ms-windows.programmer.misc
From: d88-jwa@mavros.nada.kth.se (Jon Wtte)
Subject: Re: Stallman and friends
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Thu, 7 Jan 1993 13:29:30 GMT

In <lkmpp8INN4f4@news.bbn.com> mjensen@BBN.COM (Martin Jensen) writes:

>> Why would I pay FSF (or anyone else with the same philosophy)
>> X thousand dollars to develop software and then have no way

>My company was one of the contributors to the development of GCC for
>Sun's new OS - Solaris 2.0.  We paid $2,000 to Cygnus (who provide
>support for GNU software) and in turn received a free CD-ROM distribution

>We also paid $1,000 to Intel for an i960 cross-compiler based on GCC.

The problem is that you have to have ONE customer (or a set
of customers) who is/are willing to pay for the ENTIRE development
cost, when everyone else will get it for free after that.

This is not good, since it will effectively stop me from
developing something I see a need for but nobody wants to order
before it's done.

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
From: duga@pacersoft.com (Brady Duga)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Think Ref 2.0
Date: 11 Jan 93 15:38:27 GMT
Organization: Pacer Software
X-UserAgent: Nuntius v1.1.1d17
X-XXDate: Mon, 11 Jan 93 15:36:54 GMT


Well, I seem to remember an FKEY (I had it, but lost it when I changed
jobs) that would allow you copy bits of text from a window. You could get
all the text in the window or just specify a selection rectangle. It
would put the text in the clipboard. You could only copy text actually
visible on the screen, and you would get it the way it was drawn. So, if
the last line was drawn first, you got the last line as the first line. I
think it worked by making a fake update for the window, and patching(???)
the Drawxxx calls. Anyway, I think it used to be on Sumex. I did use this
with the old Think reference. Don't know if it works under System 7, tho.

--Brady
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Subject: Re: More Win 3.x to Mac Questions: Converting Resources
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Fri, 8 Jan 1993 23:43:43 GMT

In <93008.110832REE700A@MAINE.MAINE.EDU> <REE700A@MAINE.MAINE.EDU> writes:

>  Along this same line of questions, can I convert
>those time-consuming Menu's, Icons and dialog boxes
>from their current mixture of MS Quick-C and Borland 2.0?
>  Any FTP-able or cheap app to do this would be a godsend!

You could probably write a perl script that could output
rez source for menus etc; however, beware several subtle
differences, such as the Mac having global menu key equivalents
while Windows allows the same equivalent for different menus.

Cheers,

						/ h+

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

   Nothing crashes like a Macintosh.
                     -- Guy Kawasaki
Newsgroups: comp.sys.mac.programmer,comp.os.ms-windows.programmer.tools
From: gtall@ogre.cica.indiana.edu (Gerry Allwein)
Subject: Re: Stallman and friends
Organization: Indiana University
Date: Fri, 8 Jan 1993 17:38:52 GMT

I just a simple yes or no answer to a simple question: does a parser produced
by GNU Bison fall under the FSF copyright?

Gerry

Newsgroups: comp.sys.mac.programmer
From: mtc@mundil.cs.mu.OZ.AU (Michael Trevor CUTTER)
Subject: Developing for 6 & 7
Organization: Computer Science, University of Melbourne, Australia
Date: Mon, 11 Jan 1993 01:19:45 GMT

Probably many people are in the same boat - I have to develop for 6 & 7.

This is a nightmare in many respects. However, one problem I have is this:

How do we know which toolbox calls are available in which systems?

Can I just say '6.0.4 or later please' and be safe? How do I know?

Gestalt is supported from 6.0.4 onwards, but it is in IM VI. What about the 
FSSpec stuff? The new high-level file calls like DirCreate? How can I find out
what the minimum system is? I don't want to limit myself to IM V if possible...

Please help, this is driving me nuts!

Regards,
	Mike.

-- 
Michael Cutter                        email: mtc@mundil.cs.mu.oz.au
Ictinus Network Development Team             mtc@arbld.unimelb.edu.au
BCAT Development Team                 snail: c/- 3 Barton Street
Department of Architecture & Building        Hawthorn, VIC, 3122 
University of Melbourne, Australia           AUSTRALIA
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Mac serial communication.
Date: 8 Jan 93 17:16:32 GMT
Organization: Royal Institute of Technology, Stockholm, Sweden

In <1993Jan7.210540.12691@panther.mot.com> asu@server2.panther.mot.com (Russell Trotter) writes:

>Were working on some dial-up software here and I have a few
>questions for you guys.  our application is sorta just like

>serial driver configuration to get fast throughput?  Are there
>any PD libraries or commercial libraries that I should look
>in to rather than rolling my own?  Thanks!

Use the comms toolbox. That's another Inside Mac voluem all
by itself. Any comm program NOT using it is scrapped these
days, since you won't get at any serial ports except modem&printer
without it.

Cheers,

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

   There's no sex act that can't be made better with Yell-O.
Newsgroups: comp.sys.mac.programmer
From: reriksso@klaava.Helsinki.FI (era eriksson)
Subject: Changing window positions with ResEdit
Organization: .ObJoke
Date: Sat, 9 Jan 1993 18:26:35 GMT

Just a quickie -- forgive me if I'm in the wrong newsgroup or the
subject is in some FAQ i should know about. 

I don't read this group normally, so please direct all followups to
private email. 

I'd like to patch PageMaker's default window positions somehow.
Specifically, I'd like to make the main document window smaller so that
the floating palette windows don't overlap it. 

I've seen resources in other programs which control window positions,
but haven't been able to locate anything like it in my copy of PageMaker
(4.2, localized Swedish) and I'm not very experienced with ResEdit so I
would very much like to hear from you -- specific how-to instructions
and general thoughts on the subject are equally welcome. 

Thanks in advance, 


-- 
/* era */

-- 
era eriksson      .ObQuote: <none>    .ObDiscl: I rarely know what I'm doing
Newsgroups: comp.sys.mac.programmer
From: menes@statistik.tu-muenchen.de (Rainer Menes)
Subject: Re: Sozobon (or other free C's): would this strategy work?
Originator: menes@suniams2.statistik.tu-muenchen.de
Organization: Technische Universitaet Muenchen, Germany
Date: Thu, 7 Jan 1993 09:54:42 GMT
Distribution: comp


Hey all,

I think yes, because the gcc port 1.37 is for me very helpfull.

1. The gcc Compiler is used for most publicdomain unix programs, so you
   won't have any trubble with the compiler it self (too big arrays, short ints
   and so on and on).

2. The code is in most cases is 1.2 to 1.5 times faster the Think-C and MPW C.
   (up to 2.0 for special cases. This helps use to forget the slowness of gcc
   compiling programs)
   This helps use to wait with the update for a new maschine or speed up the
   program it self for example rendering, raytracing.

3. It makes it possible for every one who likes to program in C, C++ and
   Objectiv-C without paying alot of money for in my eyes toys like Think-C
   (to prevent picking on me this is my personal view !!!), or the MPW enviroment
   were you have to buy the shell, C and C++ every thing extra. (You pay alot of
   for something witch is slower and has more bugs than gcc).

Now the prof for what I said before.

The last project I worked on was an MPEG to quicktime converter for the Mac.
With Think-C no way, because off the limitations with big static datastructures.
If you write a program yourself than that may not be a problem but for 100kbyte of write code you get mad. Even with the MPW-C no better luck after fixing all problems the program decodes only garbage. This is a problem with long defines
and optimisation witch is buggy in MPW-C. The only compiler witch I could find 
to do my job was gcc 1.37 no problem at all. This wasn't the only project were
gcc does an perfect job. I ported the first pd JPEG program to the mac, dkb-2.12
and so on. With JPEG and dkb-2.12 it was possible to compile with MPW-C but,
the programs were 1.2 to 1.6 times slower than with MPW-C.

But many Mac-programer wouldn't be happy with gcc because you are not able to
compile one line off code with toolbox calls in it. I personaly spilt the projects
in files for toolbox calls and other. The toolbox files are compiled with MPW-C and the rest with gcc and than link together. For POV-Ray 1.0 I get 1.2 more
performace that with MPW-C. Not mutch but for 48 hours tracing time you save 8
hours an hole working day.

Rainer

P.S: I only have access to a development maschine with MPW-C and Think-C in my
sparetime (in a lab near me) so I could spend alot of time programing the Mac.
From: walrath@faw.uni-ulm.de (Wayne K. Walrath)
Subject: RE: Stallman and friends (Wrong Group!!!!!)
Organization: FAW (Research Institute For Applied Knowledge Processing, Ulm, Germany)
Date: Thu, 7 Jan 1993 14:46:58 GMT

I'm getting tired of sorting through the messages not directly related
to programming the macintosh. Could you folks keeping the "Stallman 
and Friends" thread alive, kindly move it to another group, or else continue
it through private mail.  

Thanks.
--
From: mkelly@mystix.cs.uoregon.edu (Michael A. Kelly)
Newsgroups: comp.sys.mac.programmer
Subject: C.S.M.P. Digest V2 #2 Available
Date: 8 Jan 93 12:43:33 GMT
Article-I.D.: cs.1993Jan8.124333.11453
Followup-To: poster
Organization: University of Oregon Computer and Information Sciences Dept.


C.S.M.P. Digest             Fri, 08 Jan 93       Volume 2 : Issue 2

Today's Topics:

	How can I draw arrowheads on lines?
	How long can an AE handler take?
	Calling C from Pascal vs calling Pascal from C
	Perfect Window Zooming (longish)
	Is this a BaseAddress problem with the Quadra .?.?.?.



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.  If you don't have access to news, there is
no way that I know of for you to post articles to the group.

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                                               Senior Partner
mkelly@cs.uoregon.edu                                      High Risk Ventures
_____________________________________________________________________________
Newsgroups: comp.sys.mac.programmer
From: scottj@magic.dml.georgetown.edu (John L. Scott)
Subject: Re: moof?
Followup-To: comp.sys.mac.programmer
Organization: J. Random Misconfigured Site
Date: Thu, 7 Jan 1993 14:20:17 GMT
X-Posted-From: iamac-1.dml.georgetown.edu
NNTP-Posting-Host: sol.ctr.columbia.edu

In article <01050023.n126gy@chinchilla.cars.com>, niel@cars.com (Niel
Bornstein) wrote:
> 
> 
> >>>>moof?
> >>>foom!
> >>omfo!
> >oomf?
> ofom.
mofo!


Sorry for cursing.
Newsgroups: comp.sys.mac.programmer
From: jmunkki@vipunen.hut.fi (Juri Munkki)
Subject: Re: QuickDraw: Why Can't it Mirror Right?
Reply-To: jmunkki@vipunen.hut.fi (Juri Munkki)
Organization: Helsinki University of Technology
Date: Tue, 5 Jan 1993 21:59:48 GMT

In article <1993Jan5.191918.12324@fsl.noaa.gov> urban@yoda.fsl.noaa.gov (Art Urban) writes:
>I realize that mathematically my region will be defined correctly, but I
>want it to be drawn with some semblance of accuracy on the screen when I
>call FrameRgn(). If QuickDraw can do it correctly to the left, why can't it
>do it correctly to the right? (or vise-versa :-) )

Inside Macintosh often gives the impression that regions are infinitely
accurate when it says that regions are a mathematical representation of
areas. In fact, a region is really just a packed bitmap. The packing
method happens to be patented by Apple, but it's not fancy or anything.

So, if QD draws a line "incorrectly", then the pixels in the region will
also be incorrect in the same way.

I suggest that you try using a bitmap mask that you draw with polygons.
It may be faster than using regions, although this depends on the situation.

-- 
  Juri Munkki					       Windsurf: fast sailing
 jmunkki@hut.fi					      Macintosh: fast software
From: positron@quip.eecs.umich.edu (Jonathan Haas)
Newsgroups: comp.sys.mac.programmer
Subject: Locating someone on AppleLink
Date: 4 Jan 93 15:53:52 GMT
Organization: University of Michigan EECS Dept., Ann Arbor

Please forgive if this is not the proper newsgroup...

Is there a way to find out someone's AppleLink address?
'finger name@applelink.apple.com' returns 'applelink.apple.com:
unknown address', and 'finger name@apple.com' returns 'apple.com:
connection refused'.

-- 
__/\__  Jonathan S. Haas         | Jake liked his women the way he liked
\    /  University of Michigan   | his kiwi fruit: sweet yet tart, firm-
/_  _\  positron@eecs.umich.edu  | fleshed yet yielding to the touch, and
  \/    Finger for PGP key       | covered with short brown fuzzy hair.
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Newsgroups: comp.sys.mac.programmer
Subject: Re: How to do multiple mod keys for menu command?
Date: 5 Jan 93 10:21:20 GMT
Organization: Royal Institute of Technology, Stockholm, Sweden

In <C0DG2y.B2x@gpu.utcs.utoronto.ca> farm@gpu.utcs.utoronto.ca (B. Munroe) writes:

>shift-command-P for another function (and have the nice little up arrow
>appear beside the pretzel in my menu)?

>Sorry to waste the bandwidth on such a simple question but I've up and
>down IM to no avail.

It's simple. Just write your own MDEF. Yes, I know, a pain,
but that's the only way. (And you can't rely on MenuKey to
do the right thing anymore)

Cheers,

							/ h+

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

   Cookie Jar: Vanilla Yoghurt with Crushed Oreos.
Newsgroups: comp.sys.mac.programmer