[comp.sys.mac.programmer] Basic THINK C...

dave@ironcity.gatech.edu (David K. Codelli) (12/31/90)

A few weeks ago, I posted a question about whether THINK C would
be a good platform for an application I was writing.  Thanks
to all those who responded, and I have decided to go ahead
with it.

I have programmed in C and I am familiar with object-oriented 
programming, but I'm having some trouble working with the class
library in THINK C.  Here is my question:  Suppose I wanted to 
add a dialogue box to the TinyEdit application that comes with 
the package.  Suppose I want this box to come up when the user
clicks the "About..." selection of the Apple Menu of TinyEdit.
Unless I am mistaken, I create a subclass of the dialog box 
object and write a method that says that when it is drawn,
to write up whatever information I want displayed.  What I 
don't understand is, what part of the existing application do
I have to modify to get it to draw my box when the user 
clicks "About..."?

Also, I think the answer to this question is yes, but do I need
to use ResEdit to make the dialogue box a resource?

Sorry for the neophyte questions, but I really am confused.

Thanks in advance,

David

David K. Codelli                  |"Are you sure you don't want some-
Georgia Institute of Technology   | thing for the pain, Col. Flagg?
Internet: gt7315a@prism.gatech.edu| I mean, to make it worse!"
NeXTMail: dave@ironcity.gatech.edu|                        -Hawkeye 

emmayche@dhw68k.cts.com (Mark Hartman) (12/31/90)

In article <19031@hydra.gatech.EDU> dave%ironcity.gatech.edu@gatech.edu (David K. Codelli) writes:
>I have programmed in C and I am familiar with object-oriented 
>programming, but I'm having some trouble working with the class
>library in THINK C.  Here is my question:  Suppose I wanted to 
>add a dialogue box to the TinyEdit application that comes with 
>the package.  Suppose I want this box to come up when the user
>clicks the "About..." selection of the Apple Menu of TinyEdit.
>Unless I am mistaken, I create a subclass of the dialog box 
>object and write a method that says that when it is drawn,
>to write up whatever information I want displayed.  What I 
>don't understand is, what part of the existing application do
>I have to modify to get it to draw my box when the user 
>clicks "About..."?

In the subclass of CApplication that you create for your own application,
there's a "DoCommand" method.  See also p. 215ff of the THINK C book.

>Also, I think the answer to this question is yes, but do I need
>to use ResEdit to make the dialogue box a resource?


It's generally best.  Try to get V2.1, if possible.

>David K. Codelli                  |"Are you sure you don't want some-
>Georgia Institute of Technology   | thing for the pain, Col. Flagg?
>Internet: gt7315a@prism.gatech.edu| I mean, to make it worse!"
>NeXTMail: dave@ironcity.gatech.edu|                        -Hawkeye 

-- 
Mark Hartman, N6BMO           "What are you just standing there for?  Where
Applelink: N1083 or BINARY.TREE      do you think you are, DIS-ney World??"
Internet: emmayche@dhw68k.cts.com                -- General Knowledge, from
uucp: ...{spsd,zardoz,felix}!dhw68k!emmayche                CRANIUM COMMAND

Lawson.English@p88.f15.n300.z1.fidonet.org (Lawson English) (01/01/91)

David K. Codelli writes in a message to All

DKC>  What I don't understand is, what part of the existing application 
DKC> do I have to modify to get it to draw my box when the user clicks 
DKC> "About..."? 
DKC> Also, I think the answer to this question is yes, but do I need 
DKC> to use ResEdit to make the dialogue box a resource? 

Moodify the DoCOmmand method in CyourApplication to recognize the "About" command.
Then Initialize the CyourAboutBox object, "do it," and "free" it, or you can
"init" the About object once, and have methods to hide and show it.

Lawson
 

--  
Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!300!15.88!Lawson.English
Internet: Lawson.English@p88.f15.n300.z1.fidonet.org