Hi James,
1. When you say "accessing various objects in code," which objects do you
mean?
I mean accessing the object tree hierarchically programatically, the same
way object navigation allows you to do in NVDA itself. To be honest I
thought there may have been some helper functions that allow you to find
controls based on certain information, rather than having to try and find
the object manually. Especially given that it could be in different places
depending on the information that the summary shows.
2. Do you understand how event handlers work, and the fact that they receive
the object on which the event was fired as an argument?
I wasn't sure about that, but now you mention it, it makes sense. I'm
guessing that's why you have to check various things about the object,
because it could be anything that has triggered the event. Is that why it
beeped pretty much on every control change when I did the example gain focus
event in the dev guide?
3. Do you understand that, from within an event handler function, you can
find other objects using the object delivered to your function as a starting
point?
You wrote that as part of the same question, but to me that is something
totally different. I didn't know that at all. How can one object let you
access all others?
4. Do you understand what methods and attributes objects have to help you
find other objects around them, e.g. simpleNext, simplePrevious,
children, etc?
I'm guessing that's what my biggest problem is. I know nothing about these.
5. Have you tried using the NVDA Python console to navigate around an
application you're familiar with to get a feel for how all of this works?
No, because again I wouldn't know what to put in there. What I did do is try
to get the focus information in the console, but it didn't show me any of
the variables it had created for me. Even if it had, I'd have no idea how to
make something actually happen as I know nothing of the NVDA source code,
all I know how to do is make it beep.
6. Have you ran the Python built-in function dir on an object to see what
properties and methods it exposes? Object introspection at runtime is one
of Python's biggest bonuses, and you're probably going to need it.
No, because again I knew nothing of the existence of this function.
7. Have you downloaded the code of some other app modules contributed by the
community to see if you can figure out how they work?
I wouldn't even know what to start looking at, as most of them are a lot
more complex than what I am trying to do. I do use several addons (GoldWave,
NVDA Remote, System Tray list etc) but to me they just sound way, way too
advanced for me to start looking at their code at the moment.
8. Some of the app modules that ship with NVDA itself, if you check out the
source code, are not overly complicated.
A lot of the apps NVDA supports (such as Microsoft Office) I don't actually
have, so I can't compare the code to what it might be trying to do with the
object.
9. Earlier, you were completely stumped by the snippet of code that I
posted. You need to understand how that works.
When you explained the workings, I understood a lot more than I did
beforehand.
Kind regards,
Damien.
-----Original Message-----
From: James Scholes
Sent: Friday, April 15, 2016 2:41 PM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Developing Addons - The best way to get started?
Damien Sykes-Pendleton wrote:
This is seeming to be a much more complicated job than I originally
thought - I've still no idea how to access various objects in code, let
alone try and apply logic about object positioning, ordering and/or
hierarchies.