[comp.sys.mac.programmer] Minor THINK C Complaint

CXT105@psuvm.psu.edu (Christopher Tate) (08/29/90)

Here's something that has been bothering me for quite a while, and I'd like
to hear what other THINK C users have to say about it.

One of the things I love about THINK C is the ability to option-click in a
window's title bar to get a pull-down list of all the header dependencies
of that file, or of the entire project (if you click in the project window's
title bar).

Unfortunately, if you use a precompiled header (which I do A LOT), the header
that you compiled doesn't show up in the list.  For me, this expands the
usual "option-click, open header file" step to "Command-O, descend the
directory tree, open header file" -- much slower.  How hard would it be
to embed the name (and directory, or whatever is done for uncompiled
headers) of the original header file in the precompiled version?  That way,
there would be no sacrifice of utility when using precompiled headers.  Often
I find that I NEED to use precompiled headers, since otherwise a full make
would take me all day -- AppleShare servers and floppies are slow.

My current workaround is to keep the header file open in a window at all
times, but that clutters up the screen something fierce, especially on an
SE.  Having the ability to quickly open the header files without going
through the Standard File dialogs is a beautiful feature -- I just wish
I could do the same with precompiled headers.

Come to think of it, it would be nice if the compiler remembered the name
that the precompiled header had been saved under, the same as it does for
the "Build Application..." name.  And a command-key for "Precompile Header"
would be handy, too....

-------
Christopher Tate                       |
cxt105@psuvm.bitnet                    | nobody, not even the rain,
cxt105@psuvm.psu.edu                   |   has such small hands.
 ..!psuvax1!psuvm.bitnet!cxt105        |

gerhard@cs.arizona.edu (Gerhard Mehldau) (08/30/90)

In article <90241.121931CXT105@psuvm.psu.edu>, CXT105@psuvm.psu.edu (Christopher Tate) writes:
> Here's something that has been bothering me for quite a while, and I'd like
> to hear what other THINK C users have to say about it.

> [ Accessing precompiled headers by option-clicking on the titlebar ]

  Agreed.

> Come to think of it, it would be nice if the compiler remembered the name
> that the precompiled header had been saved under, the same as it does for
> the "Build Application..." name.

  Yes, and change the default button in the "Replace existing <filename>?"
  dialog to "Yes" (I realize that this requires hacking StdFile, and
  probably doesn't conform to Apple's human interface guidelines...).

> And a command-key for "Precompile Header" would be handy, too....

  You can do this yourself: just use ResEdit on the MENU resource.
  I moved Command-Y from Check Syntax (which I rarely use) to
  Precompile in my copy of the application.  I also modified a
  few others that I were unhappy with - in particular, it always
  bothered me that Command-W didn't close the frontmost window,
  and that Command-P didn't print...

- Gerhard

-- 
-> Gerhard Mehldau
   Dept. of Computer Science	internet: gerhard@cs.arizona.edu
   University of Arizona	uucp:     {cmcl2,noao,uunet}!arizona!gerhard
   Tucson, AZ 85721, U.S.A.	voice:    +1 (602) 621-4632

carlton@draco (Mike Carlton) (08/30/90)

In article <24727@megaron.cs.arizona.edu> gerhard@cs.arizona.edu (Gerhard Mehldau) writes:
...
>
>  Yes, and change the default button in the "Replace existing <filename>?"
>  dialog to "Yes" (I realize that this requires hacking StdFile, and
>  probably doesn't conform to Apple's human interface guidelines...).
>
...
>- Gerhard
>
>-- 
>-> Gerhard Mehldau
>   Dept. of Computer Science	internet: gerhard@cs.arizona.edu
>   University of Arizona	uucp:     {cmcl2,noao,uunet}!arizona!gerhard
>   Tucson, AZ 85721, U.S.A.	voice:    +1 (602) 621-4632

You can change the default button in the "Replace existing <filename>?"
dialog to "Yes" yourself with ResEdit.  Simply open the System file,
locate the correct ALRT template and in the view as text mode, change
the default button from 1 to 2.  Save and you're all set.

Of course, this is a global, permanent change.  Every use of standard
file in every application will default to the overwrite case -- use it at 
your own risk.  I much prefer this default though and always change the 
dialog when I have to copy over a new System file.

Cheers,
Mike Carlton, UC Berkeley Computer Science	  	  	   	  ~
carlton@ernie.berkeley.edu    ...!ucbvax!ernie!carlton 		 	Manana

siegel@endor.uucp (Rich Siegel) (08/30/90)

In article <90241.121931CXT105@psuvm.psu.edu> CXT105@psuvm.psu.edu (Christopher Tate) writes:
>
>One of the things I love about THINK C is the ability to option-click in a
>window's title bar to get a pull-down list of all the header dependencies
>of that file, or of the entire project (if you click in the project window's
>title bar).
>
>Unfortunately, if you use a precompiled header (which I do A LOT), the header
>that you compiled doesn't show up in the list.  For me, this expands the
>usual "option-click, open header file" step to "Command-O, descend the

	If you option-Click in the project window's title bar, then you'll
get a list of all files included by all files in the project. Therefore, if
you add the source to your precompiled header to the project document,
(e.g. Mac #includes.c), you can pull down the names of the precompiled
header's component .h files from the project window itself.

R.
 Rich Siegel	Software Engineer	Symantec Languages Group
 Internet: siegel@endor.harvard.edu	UUCP: ..harvard!endor!siegel

I hate fascist Pnews implementations which limit the .signature to 4 lines.

gerhard@cs.arizona.edu (Gerhard Mehldau) (08/30/90)

In article <38519@ucbvax.BERKELEY.EDU>, carlton@draco (Mike Carlton) writes:

>>  Yes, and change the default button in the "Replace existing <filename>?"
>>  dialog to "Yes"...
> 
> You can change the default button in the "Replace existing <filename>?"
> dialog to "Yes" yourself with ResEdit.  Simply open the System file,
> locate the correct ALRT template and in the view as text mode, change
> the default button from 1 to 2.  Save and you're all set.

  ------------------------------^
  To do this, you need to check all four check boxes labeled "2 bold"
  (It wasn't obvious to me, I had to ask Mike what he meant...).

> Of course, this is a global, permanent change.  Every use of standard
> file in every application will default to the overwrite case -- use it at 
> your own risk.  I much prefer this default though and always change the 
> dialog when I have to copy over a new System file.
> 
> Cheers,
> Mike Carlton, UC Berkeley Computer Science	  	  	   	  ~
> carlton@ernie.berkeley.edu    ...!ucbvax!ernie!carlton 		 	Manana

  I did a little experiment, and I found that you can apply this change
  selectively to THINK C (or any other application) by first copying the
  ALRT resource (# -3996) into the resource fork of the application, and
  then applying the change only there.  It is not even necessary to copy
  the corresponding DITL resource...

- Gerhard

-- 
-> Gerhard Mehldau
   Dept. of Computer Science	internet: gerhard@cs.arizona.edu
   University of Arizona	uucp:     {cmcl2,noao,uunet}!arizona!gerhard
   Tucson, AZ 85721, U.S.A.	voice:    +1 (602) 621-4632

ts@cup.portal.com (Tim W Smith) (08/31/90)

1. If you want to change the default just in Think C, you could
try copying the ALRT from the System file to Think C, and changing
it there.

2. Simply Add MacHeaders.c, or whatever it's called, to your project.
Then, all the standard files will show up when you option-click on
the title of the project window.

						Tim Smith