home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 13055 < prev    next >
Encoding:
Internet Message Format  |  1992-07-27  |  2.6 KB

  1. Path: sparky!uunet!gatech!destroyer!sol.ctr.columbia.edu!ira.uka.de!chx400!ugun2b!ugsc2a!jordi
  2. Newsgroups: comp.sys.mac.programmer
  3. Subject: AEInteractWithUser help needed !!!
  4. Message-ID: <1992Jul27.110315.935@sc2a.unige.ch>
  5. From: jordi@sc2a.unige.ch
  6. Date: 27 Jul 92 11:03:15 +0200
  7. Organization: University of Geneva, Switzerland
  8. Lines: 58
  9.  
  10. Hello netters,
  11.  
  12. I have a beginner's problem using the AEInteractWithUser function (in C)...
  13.  
  14. As I would like to bring a dialog window to the front of the screen,
  15. wherever my process is running in background or in foreground, I use the 
  16. following code:
  17.  
  18.    Error = AESetInteractionAllowed( kAEInteractWithAll ) ;
  19.    ...
  20.    Error = AEInteractWithUser( kAEDefaultTimeout, NIL_POINTER, HandleEvent ) ;
  21.    if ( Error == noErr )
  22.       {
  23.          ...
  24.          code for dialog window display
  25.          ...
  26.       }
  27.    Play_Beep() ;
  28.  
  29.  
  30. (Error is of type OSErr.)
  31.  
  32. The AEInteractWithUser function returns 'noErr' and the code block included 
  33. between the {} "must" be executed. My 'Play_Beep' procedure is executed.
  34.  
  35. The problem is that the whole process (the dialog window) does not come to
  36. the foreground when expected (what AEInteractWithUser is supposed to do: 
  37. bringing it to the front, interact, and goind back again).
  38.  
  39. It comes to the foreground only if I click on one of its windows, THEN it
  40. executes the code included between the { }. It sounds like the code is queued
  41. somewhere, skiped, and only executed when the process comes to the front...
  42.  
  43. I think I have to enable the kAEAlwaysInteract flag in order to let AESend
  44. use it. But how is it possible to set this flag as an option for 
  45. AEInteractWithUser ? (Page 6-52 of Inside Mac Volume VI) 
  46. AESend is used by AEInteractWithUser.
  47. What is exactly the problem ? (I use Think C 5.0.2)
  48.  
  49. Does anybody here have a short and easy to use example routine to show me
  50. how to deal with such AE functions ?
  51.  
  52. I thank you for your help !!!
  53.  
  54. Sincerely,
  55.  
  56. Steve Jordi
  57.  
  58. +-----------------------------+-----------------------------------+
  59. | Steve JORDI                 | Fax        : + 41 22 320-5732     |
  60. | Dpt of Geophysics           |                                   |
  61. | University of Geneva        | Internet   : jordi@sc2a.unige.ch  |
  62. | 13, Rue des Maraichers      | Bitnet     : jordi@cgeuge52       |
  63. | 1211 Geneva 4               | Compuserve : 70143,3056           |
  64. | Switzerland                 |              (once a week)        |
  65. +-----------------------------+-----------------------------------+
  66. |       D o n ' t   W o r r y ,   B e   A p p l e   ! ! !         |
  67. +-----------------------------------------------------------------+
  68.