[comp.sys.mac.programmer] Dialogs

rg2c+@andrew.cmu.edu (Robert Nelson Gasch) (12/11/90)

Hi,
I'm trying to get a dialog where the user has to enter a string
to work, but for some reason I can not trap the result. Does
anybody have any sample code I could look at?(Perferably C) I'm 
probably not missing much, but I've tried everything I could think of
and nothing works. The book I have covers this section in
too little detail so it isn't much help.

Thanx alot --> Rob

Chris.Gehlker@p12.f56.n114.z1.fidonet.org (Chris Gehlker) (12/16/90)

RNG> Hi, I'm trying to get a dialog where the user has to enter a 
RNG> string to work, but for some reason I can not trap the result. 
RNG> Does anybody have any sample code I could look at?(Perferably 
RNG> C) I'm probably not missing much, but I've tried everything I 
RNG> could think of and nothing works. The book I have covers this 
RNG> section in too little detail so it isn't much help.

The easy way to do this is to make the string an Editable Text and DISabled
item. Then the Dialog Manager will handle editing for you.  When the user 
clicks
the OK button just use GetIText() to retrieve the text. 
 

--  
Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!56.12!Chris.Gehlker
Internet: Chris.Gehlker@p12.f56.n114.z1.fidonet.org

rsherman@mthvax.cs.miami.edu (Roby Sherman) (01/26/91)

A couple of questions...

1>How does one put a dialog up on the screen when you're code is in an INIT
enviroment.. I don't know if I should try the standard toolbox startup
routines (MaxApplZoom, etc) or what. If I don't my code crashes.. I'm very
confused! help!

2>I've never learned how INITs put their Icons on the screen.. I'm assuming
it's simply PlotIcon, but I'm curious how they get the X and Y of where the
last Icon was placed so they can position theirs.


-- Roby

-- 
Roby Sherman      | Ye olde Nets : rsherman@mthvax.cs.miami.edu
//Interealm\\     +-----------------------------------------------------------
P.O. box 63-04    | Smart     : When you only believe half of what you hear. 
Miami, Fl 33163   | Brilliant : When you know which half to believe! <grin> 

Chris.Gehlker@p12.f56.n114.z1.fidonet.org (Chris Gehlker) (01/28/91)

2>I've never learned how INITs put their Icons on the screen.. I'm assuming
RS> it's simply PlotIcon, but I'm curious how they get the X and 
RS> Y of where the last Icon was placed so they can position theirs. 

There is a standard way to do this.  Look for "ShowINIT" on the developer CD.
 
--  
Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!56.12!Chris.Gehlker
Internet: Chris.Gehlker@p12.f56.n114.z1.fidonet.org

hawley@adobe.COM (Steve Hawley) (01/31/91)

In article <1991Jan29.075003.7313@actrix.gen.nz> Bruce.Hoult@bbs.actrix.gen.nz writes:
>Roby Sherman writes:
>> 2>I've never learned how INITs put their Icons on the screen.. I'm assuming
>> it's simply PlotIcon, but I'm curious how they get the X and Y of where the
>> last Icon was placed so they can position theirs.
>
>One way is to just drop the following INIT into your file, in adition to
>your own one (both will be executed).  Make sure it has the same ID as the
>ICN# you want displayed -- it's set to 128 at the moment.


Cute idea, but boy does it go against any sort of sensibilty.  It reminds me
of an Eyebeam cartoon that was an advertisement for a drug to take to rid
you of all your drug dependencies.  And if you get a headache thinking about
being dependent on one drug to cure your drug dependencies, remember, they
make headache pills too.

The point being, if he asks for code for displaying icons, give him code.
The patch should be saved for those who were unwilling to add the icon stuff
on their own...

Steve Hawley
hawley@adobe.com
-- 
"Did you know that a cow was *MURDERED* to make that jacket?"
"Yes.    I didn't think there were any witnesses, so I guess I'll have to kill
 you too." -Jake Johansen