コード例 #1
0
ファイル: file_dialogs.py プロジェクト: wty0512/micropylis
    def __init__(self, *args, **kwargs):
        self.text_input = Input()

        # Set up buttons to be shown in our contents
        def on_select_button():
            self._do_select()
        self.select_button = Button("Select", on_click=on_select_button)

        def on_cancel_button():
            self._do_cancel()
        self.cancel_button = Button("Cancel", on_click=on_cancel_button)

        FileLoadDialog.__init__(self, *args, **kwargs)

        # Setup our event handlers
        def on_enter(dialog):
            self._do_select()
        self.on_enter = on_enter

        self.real_on_select = self.on_select
        def on_select(filename):
            self.text_input.set_text(filename)
        self.on_select = on_select

        def on_parent_menu_select(choice):
            self.text_input.set_text(self.parents_dict[choice])
            self._do_open()
        self.dropdown.on_select = on_parent_menu_select
コード例 #2
0
ファイル: file_dialogs.py プロジェクト: wty0512/micropylis
    def __init__(self, *args, **kwargs):
        self.text_input = Input()

        # Set up buttons to be shown in our contents
        def on_save():
            self._do_select()
        self.save_button = Button("Save", on_click=on_save)

        def on_cancel():
            self._do_cancel()
        self.cancel_button = Button("Cancel", on_click=on_cancel)

        FileLoadDialog.__init__(self, *args, **kwargs)

        # Setup our event handlers
        def on_enter(dialog):
            self._do_select()
        self.on_enter = on_enter

        self.real_on_select = self.on_select
        def on_select(filename):
            self.text_input.set_text(filename)
        self.on_select = on_select