home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!darwin.sura.net!mips!pacbell.com!network.ucsd.edu!ucsbcsl!mcl!scott
- From: scott@mcl.ucsb.edu (Scott Bronson)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: DLOG stuff....
- Message-ID: <scott.711783028@mcl>
- Date: 22 Jul 92 05:30:28 GMT
- References: <1992Jul16.150931.27139@gmuvax2.gmu.edu> <144bvfINN8l6@agate.berkeley.edu> <scott.711532425@mcl>
- Sender: news@ucsbcsl.ucsb.edu
- Lines: 29
-
- In <scott.711532425@mcl> scott@mcl.ucsb.edu (Scott Bronson) writes:
-
- >I like to make the DITL for the DLOG consist of only one item: a PICT
- >resource that covers the entire dialog. Make sure the item is enabled.
- >Then, your about code looks like this (clean and concise):
-
- > dp = GetNewDialog( 131, nil, (WindowPtr)-1L );
- > if( dp ) ModalDialog( nil, &i );
- > DisposeDialog( dp );
-
- >Dunno why more people don't use this technique... If you want to be fancy,
- >you might pass a filterProc that will check for hitting keys to dismiss
- >the dialog also -- but that's left as an excersice for the reader.
- I'll tell you why more people don't use my EXACT technique. It's
- got a glaring bug that I didn't notice until just now. I'm suprised
- no one else on the net caught me doing this.
-
- Do you see the bug? The above code should read:
-
- dp = GetNewDialog( 131, nil, (WindowPtr)-1L );
- if( dp ) {
- ModalDialog( nil, &i );
- DisposeDialog( dp );
- }
-
-
- A rather embarassed...
-
- - Scott
-