• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
tracking ContextMenu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tracking ContextMenu


  • Subject: tracking ContextMenu
  • From: Felipe Heidrich <email@hidden>
  • Date: Tue, 25 Mar 2014 09:48:36 -0700 (PDT)

Hello,

I have a simple app with a NSButton and a NSMenu with 3 NSMenuItem,  The menu is set for the NSButton using setMenu() and works as a context menu for it.
I also added a timer to my app (the timer is added to the main loop so it ticks even when the menu is visible).
In the timer is prints:
<start code>
    NSLog(@"-------------------------------------- Timer tick ");
    NSWindow* mainWindow = [NSApp mainWindow];
    NSWindow* keyWindow = [NSApp keyWindow];
    NSWindow* accMainWindow = [NSApp accessibilityAttributeValue: NSAccessibilityMainWindowAttribute];
    NSWindow* accFocusedWindow = [NSApp accessibilityAttributeValue: NSAccessibilityFocusedWindowAttribute];
    id accElement = [NSApp accessibilityAttributeValue: NSAccessibilityFocusedUIElementAttribute];
    id accElementFocus = [NSApp accessibilityFocusedUIElement];
    
    NSLog(@"main window          %@", mainWindow);
    NSLog(@"key window           %@", keyWindow);
    NSLog(@"acc main window      %@", accMainWindow);
    NSLog(@"acc focused window   %@", accFocusedWindow);
    NSLog(@"acc ui element       %@", accElement);
    NSLog(@"acc ui element fcous %@", accElementFocus);
    NSLog(@"button               %@", button);
    NSLog(@"button cell          %@", [button cell]);
<end code>

The window is always my window, the accElement and accElementFocus are always the button cell.

This is true even when the context menu is up, and voice over is reading the selected menu item in it.
In short, my question is, if the window and the focused ui element are still back to the main window at the button cell how does VO knows how to read from the menu ?

In my application is more complicated, the menu is hosted in a separate window (NSPanel). Even when the menu is up, the  window with the button remains as the key window and main window for the app. There is special code to route the events from the main window to menu window.


Thank you
Felipe

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: [ANN] New version 1.0.8 of Accessibility Testbench
  • Next by Date: Re: background color on buttons with the new button feature in 7.1
  • Previous by thread: [ANN] New version 1.0.8 of Accessibility Testbench
  • Next by thread: Re: background color on buttons with the new button feature in 7.1
  • Index(es):
    • Date
    • Thread