Re: Strange behavior in class overlay


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

Join nvda-devel@groups.io to automatically receive all group messages.