Knowing when a dialog box is open for business?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Knowing when a dialog box is open for business?

Bill Schwab-2
Hello all,

Consider a modal dialog with lots of functionality, including some buttons
that open additional modal dialogs.  I would like to create a one-step way
to open the main dialog and one of its "child" dialogs (effectively clicking
one of the main dialog's buttons for the user).

#onViewOpened is called too soon (during #createOn:), and #onViewActivated:
is either called too soon, or not called the first time the dialog is
activated (I suspect the former but have not confirmed it).

So far, I have succeeded only by forking a thread and using a time delay
:(   Any ideas short of hacking the modal loop?

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Knowing when a dialog box is open for business?

Christopher J. Demers
"Bill Schwab" <[hidden email]> wrote in message
news:bj2gg5$e3sr9$[hidden email]...
> Consider a modal dialog with lots of functionality, including some buttons
> that open additional modal dialogs.  I would like to create a one-step way
> to open the main dialog and one of its "child" dialogs (effectively
clicking
> one of the main dialog's buttons for the user).
>
> #onViewOpened is called too soon (during #createOn:), and
#onViewActivated:
> is either called too soon, or not called the first time the dialog is
> activated (I suspect the former but have not confirmed it).
>
> So far, I have succeeded only by forking a thread and using a time delay
> :(   Any ideas short of hacking the modal loop?

I am not sure if this is much better than forking, or if it will work, but
you might try something like this in the onViewOpened:

SessionManager inputState queueDeferredAction: [self openSomeOtherDialog].

It may be worth a try.

Chris


Reply | Threaded
Open this post in threaded view
|

Re: Knowing when a dialog box is open for business?

Bill Schwab-2
Chris,

> I am not sure if this is much better than forking, or if it will work, but
> you might try something like this in the onViewOpened:
>
> SessionManager inputState queueDeferredAction: [self openSomeOtherDialog].

The problem is that this will be called from #createOn:, before I get a
chance to give the new dialog any context that would tell it whether to
pre-select items, fire commands, etc.  Maybe the answer is to duplicate
#create:on:, and set the context before calling #createView:?

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]