home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / hypercar / 4915 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  3.1 KB

  1. Path: sparky!uunet!gatech!usenet.ins.cwru.edu!cleveland.Freenet.Edu!by303
  2. From: by303@cleveland.Freenet.Edu (Jay L. Cross)
  3. Newsgroups: comp.sys.mac.hypercard
  4. Subject: palette & menu behave differently - why?
  5. Date: 25 Jan 1993 00:48:57 GMT
  6. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  7. Lines: 70
  8. Message-ID: <1jvddpINN2gm@usenet.INS.CWRU.Edu>
  9. NNTP-Posting-Host: slc10.ins.cwru.edu
  10.  
  11.  
  12. Does anyone know why handlers called by a palette act differently
  13. than the same handler called by a menu item or entered via the
  14. message box?  Here's the detail of my situation:
  15.  
  16. I've got a handler ("FRDReports") located in the stack script of a
  17. "Preferences" stack that's "in use".  This handler is called from
  18. the stacks that use the Prefs. stack, either by clicking a palette
  19. button or by selecting the Print Report... item in the file menu.
  20. The FRDReports handler sets a bunch of globals, does some other
  21. stuff, then calls the Reports(tm) external (from Nine-To-Five
  22. Software).  This handler locks error dialogs before making any
  23. calls to the external, and an errorDialog handler (also in the
  24. background of the Prefs. stack) puts up a dialog telling the user
  25. that the Reports externals are not installed (if they are
  26. installed, the errorDialog handler is never called).
  27.  
  28. The weirdness is this (if the Reports externals aren't installed):
  29. When I select Print Report... from the file menu, or type
  30. "FRDReports" into the message box, I get my custom error message
  31. as expected.  BUT, if I click the palette button, I get nothing at
  32. all.  A look at the message watcher shows that the message passing
  33. just stops when the external is called.  The scripts of the
  34. relevant handlers follow:
  35.  
  36. on FRDReports --called by palette button & Print Report... menu
  37.   if the optionKey is down then put TRUE into option
  38.   -- buncha reports globals set here --
  39.   set lockErrorDialogs to TRUE
  40.   RPControl "Flags", FALSE, FALSE ***
  41.   --if Reports is not installed, HC complains: "Can't
  42.   --understand RPControl."  This is handled by errorDialog
  43.   --(below)"
  44.   if option is TRUE then
  45.     RPControl -- display  Reports palette
  46.   else
  47.     answer file "Select the Report or View document to print:"
  48.     of type "925d"
  49.     if the result is not "Cancel" then
  50.       put it into theReport
  51.       hide message window
  52.       hide tool window
  53.       hide pattern window
  54.       RPControl "File",theReport
  55.       RPControl "PrintOptions",TRUE,1,1
  56.       RPControl "Print"
  57.       send openCard to this cd
  58.     end if
  59.   end if
  60. end FRDReports
  61.  
  62.  
  63. on errorDialog oops
  64.   if (oops contains "Reports") or (oops contains "RPControl") then
  65.     put "This stack requires the Reports(tm) externals. " & (cr)
  66.     "They are not installed on this machine." into prompt
  67.     answer prompt
  68.     exit to HyperCard
  69.   else pass errorDialog
  70. end errorDialog
  71.  
  72. ***When this is called by the palette button, the message watcher
  73. indicates that things stop here.
  74.  
  75. Anybody got any clues as to why this is so, and how I can make
  76. sure the error is handled when the palette button is clicked?
  77.  
  78. I'd appreciate any input.  Thanks very much.
  79. -- 
  80. Jay Cross  by303@Cleveland.Freenet.Edu   (CFN: by303)
  81.