HDTenEightyP/NetNews huggingface dataset:
From: Albert-Lunde@nwu.edu (Albert Lunde)
Subject: Advice on Event handling in Think Class Lib?
Followup-To: comp.sys.mac.programmer
Originator: lunde@casbah.acns.nwu.edu
Reply-To: Albert-Lunde@nwu.edu (Albert Lunde)
Organization: Northwestern University, Evanston, Illinois, USA
Date: Thu, 19 Nov 1992 05:04:42 GMT

I'm trying to convert an ANSI C program to run under Think C 5 and the TCL
application framework. The program reads an input file, writes an output
file and posts messages to standard error and a log file.

I'm starting with the Tiny Edit demo (more or less), and plan to use
the CEditText/CEditPane types in a window to display the standard error
as the program runs. (I could almost do what I want in the generic C
consol library, but I want a few file dialogs, alerts and controls.)

My problem is that I don't want to break up the old code into tiny chunks
suitable for a short idle task, because this would mean saving a lot
of state.  If I was writing this from scratch, I would call a secondary
event loop at conveinent times in the old code (periodically and after
output).  This secondary event loop would process a limited number of
events, return on an idle event and have checks against deep recursion.

I would like advice from someone familar with TCL on if there is a way
to use it's event handling to do this sort of thing in a non-violent
way.  One issue is if I can safely call the TCL event methods from
code that is being called by them. (Are the re-entreant?)

I thought of calling Process1Event from CApplication a couple of times.

Is this a good idea?


-- 
    Albert Lunde                      Albert-Lunde@nwu.edu
                                      alunde@nuacvm.bitnet
Newsgroups: comp.sys.mac.programmer
From: tnorthtj@cc.curtin.edu.au (Tim North)
Subject: Re: Just bought Think C 5.0.2DIR
Organization: Curtin University of Technology
Date: Tue, 17 Nov 1992 02:34:52 GMT

In article <1992Nov13.232726.15243@cs.ucla.edu>, jason@lanai.cs.ucla.edu (Jason Rosenberg) writes:
> We just purchased the Think C compiler.  It is version 5.0.2.  I was under
> the impression that there is a version 5.0.3 available.  Is this true?  Should
> we be entitled to a free upgrade, if this is true?  What are the main 
> differences?  Will we be just fine without this?

An upgrader program is available via FTP from the major sites. A word of warning
though: 5.0.3 has several known bugs with its optimiser. Stay with 5.0.2
until the next upgrade is made available.

Regards,
Tim North.
-------------------------------------------------------------------------------
    _--_|\      | Dept Computer Engineering, Curtin University of Technology
   /      \     | Perth. Western Australia. 6102.      Phone: (+61 9) 351 7908
-->\_.--._/     | Internet: North_TJ@cc.curtin.edu.au  FAX:   (+61 9) 351 2854
         v      |
-------------------------------------------------------------------------------
Newsgroups: comp.sys.mac.programmer
From: koehn@vms.macc.wisc.edu
Subject: Re: Apple DocViewer wish
Organization:  University of Wisconsin Academic Computing Center
Date: 23 NOV 92 16:55:33    

In article <1992Nov23.160114.12394@waikato.ac.nz>, ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes...

>After printing out another bunch of documentation in DocViewer format, it
>occurred to me that it would be really nice if Apple incorporated a paper-
>saving measure or two in DocViewer.
> 
>For example, MacWrite II adds some interesting extra buttons to its print
>dialog: you can elect to print only the even or the odd pages, and you can
>print the chosen pages in reverse order. With these features, you can do
>double-sided printing on any single-sided sheet-fed printer!
> 
>It's a wonder to me that more applications don't include these handy options.
>How about it, Apple? Think of all the paper--and shelving--you would be helping
>to save...
> 

I ended up taking my copies of NIIM to a company with a high-speed PostScript 
printer capable of imaging on both sides of a page. Still, it would be nice if 
these kinds of shenanigans weren't necessary.

BTW, big kudos to the folks at Xerox for their work on the Docutech system. I 
was able to print out all of NIIM in just under two hours, double-sided, 
600-DPI!

Now if Apple could just get the text in those things to line up right!

Brad Koehn
Data Transformations, inc.
From: grh@cs.umd.edu (Gisli R. Hjaltason)
Newsgroups: comp.sys.mac.programmer
Subject: C++ for the Mac
Date: 20 Nov 92 23:06:10 GMT
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742

I am involved with a research group here at the department that has the
intention of porting existing C++ code from UNIX to the Mac. On the UNIX side
the g++ compiler is used. The code uses a recent addition (correct me if I'm)
wrong) to C++ called templates (that may have been a part of Release 3.0?).

I'm under the impression that MPW C++ does not support templates, and someone
recently claimed that it would not support it until MPW C++ will be Lucid's
C++ compiler. The poster said that would take a while. Does anyone have more
precise information about this?

What about THINK C? When is Symantec expected to come out with a full fledged
C++ compiler? Will the first release support templates?

Someone mentioned a port of gcc for the Mac. Has anyone ported g++, or has the
intention of doing so?

Finally, are there other solutions than I have mentioned above available?

Please answer through email.

Thanks in advance...
-- 
Gisli Runar Hjaltason     | Grad Student & TA   | "The first thing we do,
Dept. of Computer Science | grh@cs.umd.edu      |  let's kill all the lawyers"
University of Maryland - College Park, MD 20742 | Shakespeare: King Henry VI
Newsgroups: comp.sys.mac.programmer
From: larsel@ifi.uio.no (Lars Yngvar Ellingsen)
Subject: HELP: Inline assembly in Think C
Keywords: assembly 
Organization: Dept. of Informatics, University of Oslo, Norway
Date: Thu, 19 Nov 1992 01:48:24 GMT
Originator: larsel@hnoss.ifi.uio.no


Yes, I know it sounds stupid, but I'm writing a flight simulator. In this
flightsim I need some quick drawing routines. I had a friend write a small
assembly routine on the amiga, but I have trouble with porting it to 
think C 5.0.2's inline assembler. Here is a (very) brushed up version of the
code:
(The routine is supposed to write a row of pixels from position x,y with 
one specific value on the screen in 8-bits color.)
(I'm extremely inexperienced with both C and asm so forgive my stupid 
blunders :)

main()
{
  GDHandle	theDevice;
  unsigned char *color;
  long          *address; 
  short         x,y,*width;
  unsigned int  color;
   
  theDevice = GetMainDevice();

  // do stuff; assign values to x, y, color and width
  
  &address = &(*(**(**theDevice).gdPMap).baseAddr)+
             (long)y*SCREENWIDTH+(long)x;
  asm {
    @Main:   move.b    color,d1
             move.w    width,d2
             movea.l   address,a1
    @Loop:   move.b    d1,(a1)+
             dbra      d2,@Loop
             rts         
  }
}

What am I doing wrong?

Yours sincerly,
Lars // larsel@ifi.uio.no
Newsgroups: comp.sys.mac.programmer
From: neeri@iis.ethz.ch (Matthias Neeracher)
Subject: Re: C++ for Mac?
Organization: Integrated Systems Laboratory, ETH, Zurich
Date: Mon, 23 Nov 1992 21:53:23 GMT

In article <By6J0B.LtB@umassd.edu> mason@cis.umassd.edu (Mason L. Bliss) writes:
   In <9440009@hpfcso.FC.HP.COM> papillo@hpfcso.FC.HP.COM (Bob Ellison) writes:

   >Is there a full C++ implementation available for Macintosh?

   Yep. There's a full C++ compiler that runs under MPW. If I were you, though,
   if its not an urgent need, I'd wait until Symantec comes out with their
   version of C++... Just my preference, though...

Symantec won't comment on if and when they will release a Think C++
Satan won't comment on if and when hell will freeze over

Have you ever considered this to be more than a coincidence ?

Matthias

-----
Matthias Neeracher                                      neeri@iis.ethz.ch
  "I wouldn't recommend sex, drugs or insanity for everyone, but
   they've always worked for me." -- Hunter S. Thompson
Newsgroups: comp.sys.mac.programmer
From: weiser@pogo.den.mmc.com (Matt Weiser)
Subject: Re: best way to pause in app ?
Organization: Martin Marietta WIS
Date: Fri, 20 Nov 1992 16:42:09 GMT

In article <brownlow.722219238@stmartin>, brownlow@informix.com (Keith Brownlow) writes:
> 
> Is there a toolbox command to make the application wait x number of seconds
> before continuing processing ?  I've tried looping for 1000's of seconds but
> without doing anything in the loop, it's more or less instantly coming back.
> 
> Anyone got a simple solution that I've missed in my manuals ?
> -- 
> -------------------------------------------------------------------------------
> |brownlow@informix.com     "Intense !"                                        |
> |brownlow@wet.com          "A repo man's always intense !"                    |
> -------------------------------------------------------------------------------

IM Vol II p.384:

PROCEDURE Delay (numTicks: LONGINT; VAR finalTicks: LONGINT);
Trap macro _Delay
On entry   A0: numTicks (long word)
On exit    D0: finalTicks (long word)

Delay causes the system to wait for the number of ticks (sixtieths of a sec)
specified by numTicks, and returns in finalTicks the total number of ticks
from system startup to the end of the delay.

Warning: Don't rely on the duration of the delay being exact; it will
usually be accurate to within one tick, but may be off by more than that.
<why is deleted because I don't think it matters in your case>

Example:
void wait( long numOfSecs )
{
   
   long numTicks = numOfSecs * 60;
   long fianlTicks; 

   Delay( numTicks, &finalTicks );
}

Matt Weiser
weiser@pogo.den.mmc.com
Newsgroups: comp.sys.mac.programmer
From: tnorthtj@cc.curtin.edu.au (Tim North)
Subject: Re: Spinning Beach Ball/ Watch
Followup-To: spinning beach ball/ watch
Organization: Curtin University of Technology
Date: Mon, 16 Nov 1992 01:56:20 GMT

In article <1992Nov11.150729.21445@Informatik.TU-Muenchen.DE>, adler@Informatik.TU-Muenchen.DE (Martin Adler) writes:
> 
> You need another resource called "acur" (animated Cursor).
> [stuff deleted]

The easier way to do this is to download the "SpinningCursor" library
and source code from the info-mac archive. 

Tim North.
-------------------------------------------------------------------------------
    _--_|\      | Dept Computer Engineering, Curtin University of Technology
   /      \     | Perth. Western Australia. 6102.      Phone: (+61 9) 351 7908
-->\_.--._/     | Internet: North_TJ@cc.curtin.edu.au  FAX:   (+61 9) 351 2854
         v      |
-------------------------------------------------------------------------------
Newsgroups: comp.sys.mac.programmer
From: jpugh@apple.com (Jon Pugh)
Subject: Re: Do I need to remove Apple event handlers at end of my code?
Date: Sat, 21 Nov 1992 06:37:43 GMT
Organization: Apple Computer, Inc.
Followup-To: comp.sys.mac.programmer

In article <goodill_eric-201192083407@ericg.cpd.tandem.com>,
goodill_eric@tandem.com (Eric Goodill) wrote:
> 
> I'm testing the Apple event waters.  Everything seems to be going just
> fine, but I have a question about whether I need to deinstall the Apple
> event handlers that I installed at the beginning of my code?  IM 6
> documents the remove routine, but doesn't say whether my code must remove
> the handlers explicitly or the OS just figures it out when my program
> stops.  I currently do not remove the handlers, and everything seems fine.

Your application event table is removed automagically when your app quits. 
You should always remove any System handlers though.  They are not removed
when you quit and will point into space if you do quit without removing
them.

Jon
From: papillo@hpfcso.FC.HP.COM (Bob Ellison)
Date: Fri, 20 Nov 1992 06:52:18 GMT
Subject: C++ for Mac?
Organization: Hewlett-Packard, Fort Collins, CO, USA
Newsgroups: comp.sys.mac.programmer

Is there a full C++ implementation available for Macintosh?

Thanks for your answers -

Bob Ellison, HP Fort Collins
From: watling_p@kosmos.wcc.govt.nz
Newsgroups: comp.sys.mac.programmer
Subject: DA's that Die in THINK pascal
Date: 23 Nov 92 12:06:08 NZST
Organization: Welligton City Council, Public Access.
NNTP-Posting-Host: kosmos.wcc.govt.nz

I'm having trouble getting my DA to put itself away nicely. It's fine if the
Mac sends it the Close message but I want to have it go away on a CMD-Q. It
doesn't like CloseDriver or CloseDeskAcc. 

Newsgroups: comp.sys.mac.programmer
From: olafn@inbit.ibt.unit.no (Olaf F. Normann)
Subject: X11 client SW (library) for mac
Organization: IBT
Date: Tue, 17 Nov 92 15:09:19 GMT


Hello netters!

Does anybody know if there exists X11 library for the Macintosh?

Best regards:
Olaf F. Normann
e-mail: Olaf.F.Normann@unimed.sintef.no
Newsgroups: comp.sys.mac.programmer
From: niko@iastate.edu (Nikolaus E Schuessler)
Subject: Re: Why blat won't work on some machines
Organization: Iowa State University, Ames, IA
Date: Mon, 23 Nov 1992 22:32:18 GMT

>
>As someone who has had occassion to try to write PMMU code on the Mac before
>in a previous life, let me tell you, I can understand why someone wouldn't
 ^^^^^^^^^^^^^^^^^^

Must not have been very successful ... :)



-- 
Niko Schuessler               
Project Vincent Systems Manager              email: niko@iastate.edu
Iowa State University Computation Center     voice: (515) 294-1672
Ames IA 50010                                snail: 272 Durham
From: vautrave@disuns2.epfl.ch (Pieric Vautravers)
Newsgroups: comp.sys.mac.programmer
Subject: MPW C++ based on AT&T C++ Release 3.0 ?
Date: 16 Nov 92 15:53:26 GMT
Organization: Ecole Polytechnique Federale de Lausanne

I know (APDA august 92) that MPW C++ 3.2 is based on the AT&T CFront 2.?.
But I'm interested to know if there is a version of C++ based on the new language definition (Release 3.0).
Does anybody know if there is ? If not, how long do I have to wait to buy such a version ?

			Pieric VAUTRAVERS





-- 
---------------------------------------------------------------------
Pieric Vautravers
vautrave@di.epfl.ch

			"Felix qui potuit rerum cognoscere causas..."
				
				Virgile ( Georgiques, II,489 )

---------------------------------------------------------------------
Newsgroups: comp.sys.mac.programmer
From: leonardr@netcom.com (Leonard Rosenthol)
Subject: Re: Which SCC in Macs
Keywords: Z85C30?, SCC, Zilog
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Thu, 19 Nov 1992 19:07:42 GMT

In article <1992Nov19.165647.11318@informatik.uni-bremen.de> g16m@alf.zfn.uni-bremen.de writes:
>Maybe at least somebody knows if the SCC from Zilog is the Z85C30 and how and 
>where the registers are mapped into the memory. 
>
	Depends on which member of the Macintosh family you are working with.
Some use the Z8530 (which was the original SCC used), however with newer
models there could be additional IOP (like the IIfx & Quadras have) or their
could be a "Combo Chip" whihc handles not just the SCC functions but also
things like ADB or SCSI.  You will also find that some (like the Duo's)
don't even have a "real" SCC, they do things via a DSP chip.

>Probably that stuff is 
>described in "The Macintosh Family Hardware Manual" or the Mac SE Deveoper 
>Notes, but I couldn't get my hands on that stuff yet. 
>
	That's exactly where it is. 
	Try you local technical book store or call APDA!

-- 
-----------------------------------------------------------------------------
Leonard Rosenthol			Internet: 	leonardr@netcom.com
Director of Advanced Technology		AppleLink:	MACgician
Aladdin Systems, Inc.			GEnie:		MACgician
From: rudolph@unixg.ubc.ca (Christopher E Rudolph)
Newsgroups: comp.sys.mac.programmer
Subject: Binary Tree Problem!
Date: 24 Nov 92 03:53:20 GMT
Organization: The University of British Columbia
NNTP-Posting-Host: unixg.ubc.ca
Summary: I am having a problem with some binary search functions if anyone is in
Keywords: binary tree problem

I seem to be having a problem with getting a returned value back after a
call to insert a node on a binary tree.

I initially call the function BRANCH *insert_on_tree (DATA *dat)

where BRANCH is a typedef struct to attach to the list and DATA is some data

Here is how I do it:

BRANCH *insert_on_tree (DATA *dat)
{
   BRANCH *a;
   
   a = root;  /* assign a to point to what the roo points to */
  .
  .
  .

   if (recursive_search (a, dat)) /* a should now be attached to the tree *?
   {
      a->info = *dat;
      return a;
   }

   return NULL; /* everything failed */
}

.
.
.

int recursive_search (BRANCH *bra, DATA *dat)
{
   BRANCH  *temp;
   int result;

   result = strcmp ((bra->info.last_name), (dat->last_name));
   if (result >= 0)
   {
      /** we need to search on the left node **/
     if (bra->left_child == NULL)
     {
       bra->left_child = create_node ();
       bra = bra->left_child;
       return;
     }

      Okay, since I haven't been able to get past the first two data items
      I find myself here.  Everything goes as planned,  bra points to what
      I want it to, however, upon return, "a" doesn't point to the same
      as "bra" did before it exited, obviously I'm not setting a, however
     I thought that I was working with a to begin with.

       If anyone can help me out here I would appreciate it Email me if you
     would please.

thanks in advance,

-------------------------------------------------------------------------
||||||||| Chris Rudolph (CompSci, UBC) <rudolph@unixg.ubc.ca> |||||||||||||
--------------------------------------------------------------------------

Newsgroups: comp.sys.mac.programmer
From: neeri@iis.ethz.ch (Matthias Neeracher)
Subject: Re: Partial paths (was Re: How to store file references/names ?)
Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
Date: Wed, 18 Nov 1992 07:11:32 GMT

leonardr@netcom.com (Leonard Rosenthol) writes:
>In article <RMF.92Nov17175921@chopin.cs.columbia.edu> rmf@chopin.cs.columbia.edu (Robert M. Fuhrer) writes:
>>Of course, being able to use "relative" paths in aliases (e.g., "Up 2 folders,
>>into the folder named 'Foo'...") would solve the problem much of the time...
>>
>>Unfortunately, Apple didn't put it in (even though Unix has had this for
>>years)!
>>
>	Apple most certainly DID put in relative aliases (see the "fromFile"
>parameter to NewAlias & ResolveAlias), as well as supporting partial pathnames
>ever since HFS (when such things became valid).  To move up two leves and 
>then into a folder named foo, you would use "::::foo:".

... and you would move up three levels, not two :-)

Matthias
From: cklarson@burrito.engr.ucdavis.edu (Christopher Klaus Larson)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Hilite a Rect
Keywords: color, hilite, novice
Date: 18 Nov 92 21:14:04 GMT
Organization: College of Engineering - University of California - Davis

In article <1e9v71INNgqn@agate.berkeley.edu> bfoley@obelisk.berkeley.edu (Brian Foley) writes:
>
>How do you hilite a rect using the current hilite color?
>I am using InvertRect() now, but it would be "better" to do it
>in color.  Inside Mac is rather vague on the subject I tried using 
>
>BitClr ((Ptr) HiliteMode, pHiliteBit);  /* IM V-61 */
>

If you are using THINK C >= 5.0, the variable HiliteMode contains the 
value of the hilite mode byte, not the addresss of the hilite mode byte.
Try the following:

	*((char *)0x0938) &= 0x7F;

	or

	HiliteMode &= 0x7F; (THINK C only)

before your call to InvertRect(). That should do the trick. 0x0938 is the
address of HiliteMode and 0x7F will mask off pHiliteBit.

--Chris
cklarson@engr.ucdavis.edu
From: de19@umail.umd.edu (Dana S Emery)
Newsgroups: comp.sys.mac.programmer
Subject: Re: A problem with toupper and tolower in Think C 5.03?
Date: 17 Nov 92 11:32:46 GMT
Followup-To: comp.sys.mac.programmer
Organization: personal

In article <6958@news.duke.edu>, tasavard@phy.duke.edu (Tom Savard) wrote:
> 
> Has anyone had trouble with the functions tolower and toupper in Think C?
> A colleague and I were trying to use the function to no avail.  Then,
> we looked in the ctype.h file and noticed toupper and tolower were not defined
> like the other functions in that header.  (They substitute most functions with
> macros.)
> 

I suspect if you browse a bit deeper, you will find them defined somewhere,
perhaps in <strings.h> or <stdio.h>.

anyway, you should be aware that tolower and toupper assume ascii content.

In these days of growing international usage, that is not always valid, and
your program should avoid allowing the user to associate international
fonts to such text if you are going to make that assumption. 

System 7 has alternatives which are sensitive to the script associated
with the font of the current graphport.  Many foreign langauges dont use
upper/lower case letter forms, and no such translation would be needed, or
appropriate.

Look to IM v 6 (ch 3, 14, 15) or the upcoming new IM "Text" for more info.
(also "Guide to Software Localization")
--

Dana S Emery <de19@umail.umd.edu>
From: cconstantine@galaxy.gov.bc.ca
Newsgroups: comp.sys.mac.programmer
Subject: System 6-7 code & SourceBug?? Help?
Date: 19 Nov 92 07:35:07 -0800
Organization: BC Systems Corporation

Here is an interesting question.  I have a shell program that I am writing. 
Under System 6.0.x, I run the program and go to the file menu and pull down to
NEW for a new window (or cmd-n form the keyboard).  Under System 7, I run my
app and it comes up with the new window right away????!!!

I looked at the code in SourceBug 1.0.1 (more on this later) and found that
after calling the following function:

for (count=1; count<=3;count++)
	EventAvail(EveryEvent,&event)

I have an AppleEvent waiting that gets processed by AEProcessEvent in my
DoEvent loop.  This somehow opens the window upon startup???!!!!  Before
calling EventAvail, I have a call to FlushEvents.

is there a particular reason for this happening????


Also, How come on SourceBug, I cant step through the for loop above.  I hit the
for ... and look at my count variable to notice that it is 1 and step again to
the EventAvail and all of a sudden, it has done all 3 implementations and count
is now 4 and I cant watch it change with the events to see what kind of events
i'm getting.  Is there some way around this??  I like to watch my variables
each time through the loop, not just once!!!!!!!

Thanx in advance.

-- 
Carl B. Constantine
CCONSTANTINE@galaxy.gov.bc.ca
	"Opinions are mine only!!"
From: mgraf@sydvm1.VNET.IBM.COM (Michael Graf)
Date: Mon, 16 Nov 92 10:55:47 EDT
Newsgroups: comp.sys.mac.programmer
Subject: PICT Updates and Refreshes
Organization: Australian Programming Centre (IBMA)
Disclaimer: This posting represents the poster's view only.
News-Software: Usenet 3.0

  Can anyone please provide me with some hints, pointers, advice or
code to help me handle updates to a PICT (read in from a resource) within
a window. I would like to only have to refresh portions of the PICT, rather
than refresh the entire window, based on the current Update Region.

  Basically, I read in a specific PICT resource and display it in a window.
Then as the user makes updates, I would like to only update (via the
update event or program controlled) certain potions. I could read in the
PICT again and display it but this is very slow and inefficient, considering
all the other objects currently shown.
  There MUST be a better way !!

  Is it possible to READ IN and display portions of a PICT resource ?
or Read in and store it elsewhere and then move portions of it around ?
or Update specific portions easily ?

  Any help, advice or suggestions would be most gratefully received.
  Thanx in advance, for the help....


**********************************************************************
Regards,
  Michael Graf                INTERNET:    (mgraf@sydvm1.vnet.ibm.com)
                              BITNET:      (mgraf@vnet)
**********************************************************************