示例#1
0
 def hide(self):
     # Some menus emit a "beforeclose" event when closed. You can do that
     # with this function, but you must do it manually when needed. By
     # default, menus do not need to be opened and closed explicitly.
     self.log('action', 'Closing {}'.format(self.id))
     ev = component_event(self, 'beforeclose', 'BEFORECLOSE')
     self.dialog.app.send_events(ev)
示例#2
0
 def show(self):
     # Some menus emit an "init" event when opened. You can do that with
     # this function, but you must do it manually when needed. By default,
     # menu items can be accessed directly without opening the menu first.
     self.log('action', 'Opening {}'.format(self.id))
     ev = component_event(self, 'init', 'INIT')
     self.dialog.app.send_events(ev)
示例#3
0
文件: dialog.py 项目: crnkjck/votr
    def click_close_button(self):
        if not self.closeable:
            raise ValueError("Dialog {} has no close button".format(self.name))
        # TODO: Return unless "self.enabled" is True.

        self.app.ctx.log('action',
            'Pressing close button of {}'.format(self.name))
        ev = component_event(self.body, 'close', 'CLOSE')
        self.app.send_events(ev)