Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

AXUIElementMBS class

Super class: CFObjectMBS

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class Accessibility MBS MacCF Plugin 3.3 Yes No No Yes, macOS only No
Function: This class represents an element of the User Interface of an application.
Example:
// displays the current window title if accessibility is enabled in Mac OS X 10.2 or newer

dim SystemWideElement,FocusedApplicationElement,FocusedWindowElement as AXUIElementMBS
dim FocusedApplication,FocusedWindow,Title as AXValueMBS
dim s as String
dim cs as CFStringMBS

SystemWideElement=AccessibilityMBS.SystemWideAXUIElement
if SystemWideElement<>nil then
FocusedApplication=SystemWideElement.AttributeValue(AccessibilityMBS.kAXFocusedApplicationAttribute)
if FocusedApplication.Type=AccessibilityMBS.kAXUIElementMBSTypeID then
FocusedApplicationElement=new AXUIElementMBS
FocusedApplicationElement.Handle=FocusedApplication.Handle
FocusedApplicationElement.RetainObject

FocusedWindow=FocusedApplicationElement.AttributeValue(AccessibilityMBS.kAXFocusedWindowAttribute)

if FocusedWindow<>nil and AccessibilityMBS.kAXUIElementMBSTypeID=FocusedWindow.Type then

FocusedWindowElement=new AXUIElementMBS
FocusedWindowElement.Handle=FocusedWindow.Handle
FocusedWindowElement.RetainObject

Title=FocusedWindowElement.AttributeValue(AccessibilityMBS.kAXTitleAttribute)
if Title<>nil and Title.Type=kCFStringMBSTypeID then
cs=new CFStringMBS
cs.handle=Title.Handle
cs.RetainObject
msgbox cs.str
end if
end if
end if
end if
Notes:
e.g. a window, a menuitem or a button.
This class requires Mac OS X 10.2 to work.
Subclass of the CFObjectMBS class.

Feedback, Comments & Corrections

Super class CFObjectMBS

This class has no sub classes.

Some methods using this class:

Some events for this class:

Some examples which use this class:


The items on this page are in the following plugins: MBS MacCF Plugin.


AXObserverMBS   -   AXValueMBS




Links
MBS Xojo tutorial videos