[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modal Dialogs



I've been playing about with modal dialogs and I've found that calling
(modal-dialog win) is a bit too restrictive for what I need, here's why:

- When you call modal-dialog everything else is disabled - including
  command-C, command-V etc., since these effect menu-clicks. This seems
  to be different from normal Mac modal dialogs since the Edit menu
  normally still works.

- If a function called by an action initiated from the modal dialog
  (for example a button push) causes a window to close (any window)
  this implicity causes a (return-from-modal-dialog :closed) which isn't
  particularly convenient since the rest of the code doesn't get
  executed (it must be some sort of throw).

- When the return-from-modal-dialog is called, the modal dialog is either
  hidden or closed, but in certain circumstances I want it to stay up. (In
  my application I have to make some of my windows temporarily modal to
  stop the user clicking elsewhere. If you do a window-show it gives a
  very annoying effect of windows going away and coming back.

Has anyone else suffered from this problem?

Has anyone got any solution?

I've written my own version of modal-dialog but it has a few flaws in it:

- First I found that I had to set ccl::*processing-events* to NIL for
  it to work when called from inside my code (why NIL? I would have
  guessed T!)

- Preventing other windows from recieving events seems a question of
  either writing my own event-handler and attaching it to *eventhook*
  and checking each event to see if it is for a window other than mine
  (I feel too old for that) or writing methods for each other window that
  ignore view-click-events unless the window is the current modal one
  (this is more do-able, but hardly elegant!)

- Preventing menus from getting clicks can be done by disabling them
  temporarily.

- Implementing a throw mimics the rest of the behavior OK.

- I can't do anything about task switching, since it isn't really modal.

There must be a better way?

(I'm using 2.0b1p3 on a Mac IIcx)

Thanks

Denis