Skip to content

Add a gui.MessageDialog function, in order to gain the features of dialogs, while still protecting from calling wx.MessageDialog #12353

@XLTechie

Description

@XLTechie

Alternate proposal to #12344

Is your feature request related to a problem? Please describe.

I was trying to implement some code for a proposal of a UX bug fix.
It would have been convenient to use a dialog containing "Cancel" and "Continue" buttons.

If I was to do that in an add-on, it would be straight forward:

  1. Call wx.messageDialog, with the wx.OK | wx.CANCEL flags, in a context handler.
  2. Then call .SetOKLabel("&Continue") on the context handler instance.

However, because of a freeze issue which occurs when a dialog and an NVDA settings dialog are open at the same time, gui.messageBox was created to run a locking scheme to prevent more than one dialog, and its docstring says not to use wx.MessageDialog.

Describe the solution you'd like

In #12344, I suggested modifying gui.messageBox to use wx.MessageDialog. I made a test build doing this, and changed a dialog by restyling its buttons.
Everything worked fine, and I could not cause any failures from it.

However if there is concern about making a change wholesale like that, I will suggest as an alternative:

Creating a gui.messageDialog function.
It can call wx.MessageDialog, but wrapped in the same protections that gui.messageBox uses.
It can then offer the styling, extended messages, and so on, that wx.MessageDialog offers, but only be used when developers find its use appropriate to the situation.
All calls to gui.messageBox can then continue unaffected.

Describe alternatives you've considered

See #12344

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions