コード例 #1
0
ファイル: Display.py プロジェクト: ShuyaMotouchi/joke
    def block_cursor(self):
        return bool(self.__blockCursor.get())


    @block_cursor.setter
    def block_cursor(self, value):
        self.__blockCursor.set(value)


    @property
    def line_spacing(self):
        return int(self.__lineSpacing.get())


    @line_spacing.setter
    def line_spacing(self, value):
        self.__lineSpacing.set(value)


if __name__ == "__main__":
    if sys.stdout.isatty():
        application = tk.Tk()
        application.title("Display")
        dock = Dock(application, None)
        dock.pack(fill=tk.BOTH, expand=True)
        dock.bind("<Escape>", lambda *args: application.quit())
        application.bind("<Escape>", lambda *args: application.quit())
        application.mainloop()
    else:
        print("Loaded OK")
コード例 #2
0
        self.event_generate("<<ForegroundStyleChange>>")


    def __set_foreground_width(self, *args):
        self.event_generate("<<ForegroundWidthChange>>")


if __name__ == "__main__":
    if sys.stdout.isatty():
        def on_foreground_change(dock):
            print("foreground", dock.foreground)
        def on_background_change(dock):
            print("background", dock.background)

        application = tk.Tk()
        application.title("Colors")
        dock = Dock(application, None)
        dock.pack(fill=tk.BOTH, expand=True)
        # Since tkinter doesn't support the event.data field we must access
        # the data ourselves
        dock.bind("<<ForegroundChange>>",
                lambda *args: on_foreground_change(dock))
        dock.bind("<<BackgroundChange>>",
                lambda *args: on_background_change(dock))

        dock.bind("<Escape>", lambda *args: application.quit())
        application.bind("<Escape>", lambda *args: application.quit())
        application.mainloop()
    else:
        print("Loaded OK")
コード例 #3
0
    def __set_foreground_width(self, *args):
        self.event_generate("<<ForegroundWidthChange>>")


if __name__ == "__main__":
    if sys.stdout.isatty():

        def on_foreground_change(dock):
            print("foreground", dock.foreground)

        def on_background_change(dock):
            print("background", dock.background)

        application = tk.Tk()
        application.title("Colors")
        dock = Dock(application, None)
        dock.pack(fill=tk.BOTH, expand=True)
        # Since tkinter doesn't support the event.data field we must access
        # the data ourselves
        dock.bind("<<ForegroundChange>>",
                  lambda *args: on_foreground_change(dock))
        dock.bind("<<BackgroundChange>>",
                  lambda *args: on_background_change(dock))

        dock.bind("<Escape>", lambda *args: application.quit())
        application.bind("<Escape>", lambda *args: application.quit())
        application.mainloop()
    else:
        print("Loaded OK")
コード例 #4
0
        self.__wordWrap.set(value.title())

    @property
    def block_cursor(self):
        return bool(self.__blockCursor.get())

    @block_cursor.setter
    def block_cursor(self, value):
        self.__blockCursor.set(value)

    @property
    def line_spacing(self):
        return int(self.__lineSpacing.get())

    @line_spacing.setter
    def line_spacing(self, value):
        self.__lineSpacing.set(value)


if __name__ == "__main__":
    if sys.stdout.isatty():
        application = tk.Tk()
        application.title("Display")
        dock = Dock(application, None)
        dock.pack(fill=tk.BOTH, expand=True)
        dock.bind("<Escape>", lambda *args: application.quit())
        application.bind("<Escape>", lambda *args: application.quit())
        application.mainloop()
    else:
        print("Loaded OK")