• 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
Re: How to get the real rectangle of Push button?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the real rectangle of Push button?


  • Subject: Re: How to get the real rectangle of Push button?
  • From: Christiaan Hofman <email@hidden>
  • Date: Wed, 25 Apr 2012 12:28:49 +0200


On Apr 25, 2012, at 5:33, Dennis Duan wrote:

Hi,
 
I have a cocoa application which has some buttons on it. From another process, I use Accessibility APIs (i.e. by AXUIElement) to do some tests on these buttons.
 
When I do alignment and overlapping test, I use ‘AXPosition’ and ‘AXSize’ to get the rectangle of the button, then compare them. But I found Push button’s real region is smaller than its rectangle. Like the picture below indicates, the red lines marks the rectangle, but the real region is only the visible part in it.
<image005.png>
 
This generates the results:
1) two different bezel style buttons below look aligned at the left side visually, but in fact they are not aligned.
<image001.jpg>
 
2) two different bezel style buttons below look not overlapped visually, but in fact they are overlapped.
 
<image002.jpg>
 
From Accessibility perspective, I don’t find out any method to detect if the button is a push button or not.
 
So my question is:
1. Why is the real region of Push button smaller than the rectangle?
2. Is there any solution to get the bezel style of the button, or directly get the real region of the button?
 
Thanks in advance!
 
Best Regards!
 

You're a bit unclear about what you mean by "real region," but I assume you are referring to the visual image, and the layout rectangle in the sense as IB uses that. I think the reason should be obvious: it is really what it looks like visually. It depends on where the image is drawn, which is not necessarily the whole frame of the button, as there may be shadow etc. Now none of such display characteristics are accessible through the accessibility UI (in fact they're not even in the Cocoa framework.) It should also be irrelevant to accessibility. If you think you need to get it, you're probably abusing accessibility for something that it;s not designed for.

Christiaan

 _______________________________________________
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: Re: UISlider accessibilityValue at 100%
  • Previous by thread: Re: UISlider accessibilityValue at 100%
  • Index(es):
    • Date
    • Thread