home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 21338 < prev    next >
Encoding:
Text File  |  1993-01-12  |  2.7 KB  |  60 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!munnari.oz.au!uniwa!cujo!ncrpda.curtin.edu.au!rocky.curtin.edu.au!user
  3. From: peter@cujo.curtin.edu.au (Peter N Lewis)
  4. Subject: Re: Alert Help
  5. Message-ID: <peter-130193093811@rocky.curtin.edu.au>
  6. Followup-To: comp.sys.mac.programmer
  7. Lines: 46
  8. Sender: news@ncrpda.curtin.edu.au
  9. Nntp-Posting-Host: ncrpda.curtin.edu.au
  10. Organization: NCRPDA, Curtin University
  11. References: <1993Jan12.001107.329@physc1.byu.edu> <1993Jan12.002334.330@physc1.byu.edu>
  12. Date: Wed, 13 Jan 1993 01:42:37 GMT
  13.  
  14. In article <1993Jan12.002334.330@physc1.byu.edu>, seth@physc1.byu.edu
  15. wrote:
  16. > DANG IT! Not more than two minutes after I posted my question I went back and
  17. > started looking at my alert again and noticed that the static text that was
  18. > getting the rectangle around it was item #1. So, I tried something I hadn't 
  19. > tried yet - I tried renumbering the items. I made my button item #1, and, you
  20. > guessed it, this time the buttin was surrounded by the "default" rectangle. 
  21. > You
  22. > can tell I haven't got much experience with this yet... Well, it certainly is
  23. > embarassing to post a question on the net and find your own answer within a
  24. > couple of minutes afterwards....
  25.  
  26. Don't worry about it - there would be very few programmers who haven't at
  27. one time or another had their alert's come up with the a huge rounded
  28. rectangle around their static text items, of course once its got you once
  29. you just smile and say "ooops" :-)
  30.  
  31. > BUT, this does bring up a couple of new questions. Within the last few weeks I
  32. > seem to remember a guy asking why he couldn't get a default button surrounded
  33. > autonatically by the "default" round-corner rectangle. Someone said that this
  34. > was not autonatic, and discussed ways of doing this. On my machine with THINK
  35. > Pascal it DOES seem to be automatic. Also, why didn't this show up in ResEdit?
  36. > Is this a "feature" of THINK Pascal? It must be, as I created some alerts in
  37. > THINK C before, and I don't recall anything being surrounded by the "default"
  38. > rectangle then.
  39.  
  40. It is automatic for Alerts, except that the rounded rect isn't updated when
  41. the screen is redrawn (as far as I'm concerned, thats Apple's problem, so I
  42. don't put any code in to do it myself).
  43.  
  44. For Dialog's, its not automatic.  You can do it in one of three ways:
  45.  
  46. Use Default CDEF.
  47. Use the System 7 only SetDialogDefaultItem call.
  48. Write your own user item that draws the outline.
  49.  
  50. I use the latter (I posted Pascal code to do it here recently).  Many
  51. people have had lots of success with Default, and presumably the System 7
  52. call works easily enough if you can depend on System 7.
  53.  
  54. Have fun,
  55.    Peter.
  56.  
  57. _______________________________________________________________________
  58. Peter N Lewis <peter@cujo.curtin.edu.au>             Ph: +61 9 368 2055
  59.