home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!usenet.ins.cwru.edu!cleveland.Freenet.Edu!by303
- From: by303@cleveland.Freenet.Edu (Jay L. Cross)
- Newsgroups: comp.sys.mac.hypercard
- Subject: palette & menu behave differently - why?
- Date: 25 Jan 1993 00:48:57 GMT
- Organization: Case Western Reserve University, Cleveland, Ohio (USA)
- Lines: 70
- Message-ID: <1jvddpINN2gm@usenet.INS.CWRU.Edu>
- NNTP-Posting-Host: slc10.ins.cwru.edu
-
-
- Does anyone know why handlers called by a palette act differently
- than the same handler called by a menu item or entered via the
- message box? Here's the detail of my situation:
-
- I've got a handler ("FRDReports") located in the stack script of a
- "Preferences" stack that's "in use". This handler is called from
- the stacks that use the Prefs. stack, either by clicking a palette
- button or by selecting the Print Report... item in the file menu.
- The FRDReports handler sets a bunch of globals, does some other
- stuff, then calls the Reports(tm) external (from Nine-To-Five
- Software). This handler locks error dialogs before making any
- calls to the external, and an errorDialog handler (also in the
- background of the Prefs. stack) puts up a dialog telling the user
- that the Reports externals are not installed (if they are
- installed, the errorDialog handler is never called).
-
- The weirdness is this (if the Reports externals aren't installed):
- When I select Print Report... from the file menu, or type
- "FRDReports" into the message box, I get my custom error message
- as expected. BUT, if I click the palette button, I get nothing at
- all. A look at the message watcher shows that the message passing
- just stops when the external is called. The scripts of the
- relevant handlers follow:
-
- on FRDReports --called by palette button & Print Report... menu
- if the optionKey is down then put TRUE into option
- -- buncha reports globals set here --
- set lockErrorDialogs to TRUE
- RPControl "Flags", FALSE, FALSE ***
- --if Reports is not installed, HC complains: "Can't
- --understand RPControl." This is handled by errorDialog
- --(below)"
- if option is TRUE then
- RPControl -- display Reports palette
- else
- answer file "Select the Report or View document to print:"
- of type "925d"
- if the result is not "Cancel" then
- put it into theReport
- hide message window
- hide tool window
- hide pattern window
- RPControl "File",theReport
- RPControl "PrintOptions",TRUE,1,1
- RPControl "Print"
- send openCard to this cd
- end if
- end if
- end FRDReports
-
-
- on errorDialog oops
- if (oops contains "Reports") or (oops contains "RPControl") then
- put "This stack requires the Reports(tm) externals. " & (cr)
- "They are not installed on this machine." into prompt
- answer prompt
- exit to HyperCard
- else pass errorDialog
- end errorDialog
-
- ***When this is called by the palette button, the message watcher
- indicates that things stop here.
-
- Anybody got any clues as to why this is so, and how I can make
- sure the error is handled when the palette button is clicked?
-
- I'd appreciate any input. Thanks very much.
- --
- Jay Cross by303@Cleveland.Freenet.Edu (CFN: by303)
-