Handle Dock menu open/close events

  • Hi All,

        I have a application, in which i need to do some pre and post processing
    operations when the user open and close the dock menu. Is it possible using
    Cocoa?. f yes, please explain how?

    Regards,
    Apparao.
  • On Jan 15, 2008, at 10:29 PM, Apparao Mulpuri wrote:

    > I have a application, in which i need to do some pre and post
    > processing
    > operations when the user open and close the dock menu. Is it
    > possible using
    > Cocoa?. f yes, please explain how?

    The NSMenu delegate methods started working on Dock menus in Tiger &
    later.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • Thanks Nick,

    NSMenu  has provides methods for doing pre process operations before its
    displaying. I need to capture events after user closes the dock menu with
    out doing/'clicking on any menu items in the Dockl menu.

    - Apparao.

    On 1/16/08, Nick Zitzmann <nick...> wrote:
    >
    >
    > On Jan 15, 2008, at 10:29 PM, Apparao Mulpuri wrote:
    >
    >> I have a application, in which i need to do some pre and post
    >> processing
    >> operations when the user open and close the dock menu. Is it
    >> possible using
    >> Cocoa?. f yes, please explain how?
    >
    > The NSMenu delegate methods started working on Dock menus in Tiger &
    > later.
    >
    > Nick Zitzmann
    > <http://www.chronosnet.com/>
    >
    >
    >
    >
    >
  • I am not certain if this will actually work, but you could try doing
    performSelector:...inModes: in the preprocess step, and passing the
    NSDefaultRunLoopMode as the mode. Theoretically, while the menu is open,
    you'll be stuck in event tracking mode, and the selector will not be
    called. Once the menu closes, you'll go back to the default mode and
    wham! Your selector will get called.

    I don't know if it will work because this technique /didn't/ work for me
    with drag-and-drop in an outline view, due to what seems to be a bug in
    Apple's outline view code :(

    Apparao Mulpuri wrote:
    > Thanks Nick,
    >
    > NSMenu  has provides methods for doing pre process operations before its
    > displaying. I need to capture events after user closes the dock menu with
    > out doing/'clicking on any menu items in the Dockl menu.
    >
    > - Apparao.
    >
    > On 1/16/08, Nick Zitzmann <nick...> wrote:
    >
    >> On Jan 15, 2008, at 10:29 PM, Apparao Mulpuri wrote:
    >>
    >>
    >>> I have a application, in which i need to do some pre and post
    >>> processing
    >>> operations when the user open and close the dock menu. Is it
    >>> possible using
    >>> Cocoa?. f yes, please explain how?
    >>>
    >> The NSMenu delegate methods started working on Dock menus in Tiger &
    >> later.
    >>
    >> Nick Zitzmann
    >> <http://www.chronosnet.com/>
    >>
    >>
    >>
    >>
    >>
    >>

    >
  • The Dock menu is shown in the Dock process, not in your
    appplication's process. Your application continues to run in the
    default run loop mode, and may even receive events, while the Dock
    menu is shown.  There's no way at this point to be notified when the
    Dock menu is closed.

    If you give some more details, we might be able to suggest alternatives.

    -Peter

    On Jan 16, 2008, at 7:59 AM, John Stiles wrote:

    > I am not certain if this will actually work, but you could try
    > doing performSelector:...inModes: in the preprocess step, and
    > passing the NSDefaultRunLoopMode as the mode. Theoretically, while
    > the menu is open, you'll be stuck in event tracking mode, and the
    > selector will not be called. Once the menu closes, you'll go back
    > to the default mode and wham! Your selector will get called.
    >
    > I don't know if it will work because this technique /didn't/ work
    > for me with drag-and-drop in an outline view, due to what seems to
    > be a bug in Apple's outline view code :(
    >
    >
    > Apparao Mulpuri wrote:
    >> Thanks Nick,
    >>
    >> NSMenu  has provides methods for doing pre process operations
    >> before its
    >> displaying. I need to capture events after user closes the dock
    >> menu with
    >> out doing/'clicking on any menu items in the Dockl menu.
    >>
    >> - Apparao.
    >>
    >> On 1/16/08, Nick Zitzmann <nick...> wrote:
    >>
    >>> On Jan 15, 2008, at 10:29 PM, Apparao Mulpuri wrote:
    >>>
    >>>
    >>>> I have a application, in which i need to do some pre and post
    >>>> processing
    >>>> operations when the user open and close the dock menu. Is it
    >>>> possible using
    >>>> Cocoa?. f yes, please explain how?
    >>>>
    >>> The NSMenu delegate methods started working on Dock menus in Tiger &
    >>> later.
    >>>
    >>> Nick Zitzmann
    >>> <http://www.chronosnet.com/>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>

    >>

previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today