On 2009 Apr 24, at 17:36, Peter Ammon wrote:

Sorry, I think I misread your original message. After the menu is dismissed, then the run loop should return to the Default mode and timers in that mode should resume. The behavior you describe is pretty weird.

Thank you, Peter. I had been preparing a reply, but now it will be shorter.

Can you take a sample of the app when it is in this state? What does it show?

Yes, I did that yesterday, just recreated and saved one for you [1]. In the first thread, -[NSTableHeaderView mouseDown:], is when I click the mouse in a table header view to which the menu is attached.

--------

I tried to reproduce the problem in a demo project, like this:

    [[popUp cell] performClickWithFrame:[sender frame]
                                 inView:sender] ;

where 'sender' is a regular button instead of a NSTableHeaderView as in my real project. But in the demo project, tracking stops when the menu is closed.

On 2009 Apr 24, at 15:02, Peter Ammon wrote:

This method [attachPopUpWithFrame:inView] is mainly a holdover from NeXT menus, and isn't good for much.

Great. I just submitted Document Feedback requesting that your remark be added to the documentation, because it would have saved me quite some time. It will be interesting to see how the marketing guys translate it ;)

If you want to pop up a popup button, you can use either performClick: or trackMouse:inRect:ofView:untilMouseUp:

The latter can only be used if you have the event, so I am using the performClick:inView:. I just tried using performClick: as you suggest, but the menu fails to pop up.

If you have any clues as to what I might have done to cause this menu to continue event tracking after it has been closed, let me know -- it might save me a few hours of trial and error in converging my "bad" and "good" cases.

Jerry



[1]

Sampling process 30384 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling New Project (pid 30384) every 1 millisecond
Call graph:
    2020 Thread_2507
      2020 start
        2020 main
          2020 NSApplicationMain
            2020 -[NSApplication run]
              2020 -[NSApplication sendEvent:]
                2020 -[NSWindow sendEvent:]
                  2020 -[NSTableHeaderView mouseDown:]
2020 -[NSTableHeaderView _trackAndModifySelectionWithEvent:onColumn:stopOnReorderGesture:]
                      2020 -[NSWindow nextEventMatchingMask:]
2020 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
                          2020 _DPSNextEvent
                            2020 BlockUntilNextEventMatchingListInMode
                              2020 ReceiveNextEventCommon
                                2020 RunCurrentEventLoopInMode
                                  2020 CFRunLoopRunInMode
                                    2020 CFRunLoopRunSpecific
                                      2019 mach_msg
                                        2019 mach_msg_trap
                                          2019 mach_msg_trap
                                      1 DisposeAllMenuWindows()
1 ForEachMenuDo(long (*) (MenuData*, void*), void*)
                                          1 CFDictionaryApplyFunction
1 Dispose1MenuWindow(MenuData*, void*)
                                              1 _CFRelease
1 WindowData::Destruct() 1 HIObject::Destruct() 1 SendEventToEventTargetWithOptions 1 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) 1 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) 1 HIObject::EventHook(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) 1 HIObject::HandleClassHIObjectEvent(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) 1 HIViewWrapperDef::~HIViewWrapperDef() 1 WindowData::~WindowData() 1 DisposePlatformWindow 1 CGSReleaseWindow 1 _CGSReleaseWindowList 1 _CGSTerminateWindowList 1 mach_msg 1 mach_msg_trap 1 mach_msg_trap
    2020 Thread_2603
      2020 thread_start
        2020 _pthread_start
          2020 __NSThread__main__
            2020 -[NSThread main]
2020 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]
                2020 CFRunLoopRunInMode
                  2020 CFRunLoopRunSpecific
                    2020 mach_msg
                      2020 mach_msg_trap
                        2020 mach_msg_trap
    2020 Thread_2703
      2020 thread_start
        2020 _pthread_start
          2020 select$DARWIN_EXTSN
            2020 select$DARWIN_EXTSN
    2020 Thread_2803
      2020 0x0
        2020 0x0
    2020 Thread_2903
      2020 0x0
        2020 0x0

Total number in stack (recursive counted multiple, when >=5):

Sort by top of stack, same collapsed (when >= 5):
        0x0        4040
        mach_msg_trap        4040
        select$DARWIN_EXTSN        2020
Sample analysis of process 30384 written to file /dev/stdout


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to