We’re making progress with automated testing in our app and our testing solution relies on the Accessibility framework to locate UI elements in the view hierarchy and work with them.
Common controls (Buttons, Labels, …) show up properly when we look with Accessibility Inspector, but custom controls (e.g. based on Canvas) do not. This is not unexpected.
If I were using Interface Builder, I would set the accessibility attributes right there in the UI, but I see no corresponding Xojo UI. There are also Cocoa methods to do it, but of course they do not work from Xojo.
Question: is there another way to set accessibility attributes in Xojo? Would that be possible through the Plugin API?
How do you handle accessibility issues in Xojo?
(Note: I found a plugin from Monkeybread Software that claims to be able to do this, but I can’t make heads or tails of it…)
Im afraid that’s over my head. I havent played with the accessibility framework.
From the Apple docs, I see that the method above was deprecated and replaced by other methods in OS X 10.10.
But I am afraid that’s all I can tell.
We’re still linking against the 10.9 SDK on the Cocoa side so it’s OK. But I was mostly wondering if anyone had done accessibility stuff with Xojo. Perhaps I’m overlooking something obvious?
Only thing that comes to mind is if I understood you correctly you are using a Canvas as a base class for a custom control created by declares and tweaking the canvas view to show the control, yes?
In that case, should you address the canvas handle or not rather the id of the inserted control?
(But again, I have no experience with accessibilities)
BTW, could I ask you how you created the MakeCFString method? Usually there is the CFStringRef serving this purpose, but I am trying to put a pointer to a String into a Core.MutableMemoryblock that knows no CSTRingRef value. And I can’t figure out how to convert it the CFStringGetCharactersPtr which I suspected to be the right one returns 0 always
[code]MakeCFString(text as String) as Ptr
declare function CFStringCreateWithCString lib “CoreFoundation” ( alloc as ptr, cStr as CString, encoding as integer ) as ptr
const kCFStringEncodingUTF8 = &h08000100