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!