Topics

Strange behavior in class overlay


Alberto Buffolino
 

Hi all,
refactoring my add-on ColumnsReview:
https://github.com/ABuffEr/columnsReview
according to an old Joseph's observation, I modified the chooseNVDAObjectOverlayClasses, changing these lines from:
***
if announceEmptyList and obj.role == ct.ROLE_LIST and "listview" in obj.windowClassName.lower():
clsList.insert(0, EmptyList)
***
to:
***
if announceEmptyList and isinstance(obj, List):
clsList.insert(0, EmptyList)
***
But, for some reason, it works only in the first way. I'm confused, because if I open NVDA console over the list object, and check manually the isinstance condition, this is true.
Can someone provide a explanation?
Thanks in advance.
Alberto


Michael Curran
 

Hi,


The reason is because when an appModule or globalPlugin's chooseNVDAObjectOverlayClasses method is executed, other overlayClasses, such as List, have not yet been applied to the NVDAObject. They should however already be in clsList, and you could check for that. E.g. if List in clsList.


Mick

On 11/03/2020 10:34 pm, Alberto Buffolino wrote:
Hi all,
refactoring my add-on ColumnsReview:
https://github.com/ABuffEr/columnsReview
according to an old Joseph's observation, I modified the chooseNVDAObjectOverlayClasses, changing these lines from:
***
        if announceEmptyList and obj.role == ct.ROLE_LIST and "listview" in obj.windowClassName.lower():
            clsList.insert(0, EmptyList)
***
to:
***
        if announceEmptyList and isinstance(obj, List):
            clsList.insert(0, EmptyList)
***
But, for some reason, it works only in the first way. I'm confused, because if I open NVDA console over the list object, and check manually the isinstance condition, this is true.
Can someone provide a explanation?
Thanks in advance.
Alberto


Alberto Buffolino
 

Michael Curran, il 11/03/2020 22.19, ha scritto:
The reason is because when an appModule or globalPlugin's chooseNVDAObjectOverlayClasses method is executed, other overlayClasses, such as List, have not yet been applied to the NVDAObject.
Alberto:
ok, understand. Thanks Mick for suggestion! :)
Alberto