Entry multiline text

Rui Fontes
 

Hello!


I have the following function to collect a multiline block of text.

It is possible to replace it by a function that collects the all block at once?


    def _addBlock(self):
        # Translators: Message dialog box to add a new block of text.
        dlg = wx.TextEntryDialog(gui.mainFrame, _("Enter the block of text"), self.title)
        dlg.SetValue("")
        if dlg.ShowModal() == wx.ID_OK:
            nBlock = dlg.GetValue()
        else:
            dlg.Destroy()
            return
        if nBlock != "":
            global name
            global newBlock
            newBlock.append(nBlock)
            if gui.messageBox(_("Do you want to add a new line?"), self.title, style=wx.ICON_QUESTION|wx.YES_NO) == wx.YES:
                self._addBlock()
                return
        else:
            dlg.Destroy()
            return

Best regards,

Rui Fontes

NVDA portuguese team

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