Example #1
0
class ShowModal(FrontEndOperation):
    """
    A front end operation that displays a new modal dialog.

    The result is True if the user clicked OK and False
    otherwise. Other data entered by the user are available through
    widgets that populate the modal dialog.
    """
    def __init__(self, title, children):
        self.modal = ModalWidget(title=title, children=children)
        self.modal.on_close(self.on_close)

    def submit(self, on_done=None):
        self.on_done = on_done
        display(self.modal)

    def on_close(self, modal, button):
        if self.on_done is not None:
            self.on_done(button == 'OK')
class ShowModal(FrontEndOperation):
    """
    A front end operation that displays a new modal dialog.

    The result is True if the user clicked OK and False
    otherwise. Other data entered by the user are available through
    widgets that populate the modal dialog.
    """
    def __init__(self, title, children):
        self.modal = ModalWidget(title=title, children=children)
        self.modal.on_close(self.on_close)

    def submit(self, on_done=None):
        self.on_done = on_done
        display(self.modal)

    def on_close(self, modal, button):
        if self.on_done is not None:
            self.on_done(button == 'OK')
Example #3
0
 def __init__(self, title, children):
     self.modal = ModalWidget(title=title, children=children)
     self.modal.on_close(self.on_close)
 def __init__(self, title, children):
     self.modal = ModalWidget(title=title, children=children)
     self.modal.on_close(self.on_close)