Exemplo n.º 1
0
 def init(self):
     self.root = tk.Tk()
     w = self.pyprocessing.width
     h = self.pyprocessing.height
     self.root.geometry(f"{w + 2}x{h + 20}+20+20")
     self.root.title()
     self.window = Window(self.root, self.pyprocessing.namespace,
                          self.pyprocessing.draw)
     self.window.pack(expand=True, fill=tk.BOTH)
Exemplo n.º 2
0
 def init(self):
     self.root = tk.Tk()
     w = self.pyprocessing.width
     h = self.pyprocessing.height
     geometry = f"{w + 2}x{h + 20}+20+20"
     self.pyprocessing.logger.info('Initializing window with geometry %s',
                                   geometry)
     self.root.geometry(geometry)
     self.root.title()
     self.root.resizable(False, False)
     self.window = Window(self.root, self.pyprocessing)
     self.window.pack(expand=True, fill=tk.BOTH)
Exemplo n.º 3
0
 def init(self):
     self.root = tk.Tk()
     w = self.pp.namespace.width
     h = self.pp.namespace.height
     x, y = self.pp.namespace.window_offset
     geometry = f"{w + 2}x{h + 20}+{x}+{y}"
     self.pp.logger.info('Initializing window with geometry %s', geometry)
     self.root.geometry(geometry)
     self.root.title(self.pp.namespace.window_title)
     self.root.resizable(*self.pp.namespace.window_resizable)
     self.root.iconphoto(True, self.pp.namespace.window_icon.tk_photo_image)
     self.window = Window(self.root, self.pp)
     self.window.pack(expand=True, fill=tk.BOTH)
Exemplo n.º 4
0
class TkRenderer:
    def __init__(self, pyprocessing):
        self.pp = pyprocessing
        self.root = None
        self.window = None
        self.this = self

    def init(self):
        self.root = tk.Tk()
        w = self.pp.namespace.width
        h = self.pp.namespace.height
        x, y = self.pp.namespace.window_offset
        geometry = f"{w + 2}x{h + 20}+{x}+{y}"
        self.pp.logger.info('Initializing window with geometry %s', geometry)
        self.root.geometry(geometry)
        self.root.title(self.pp.namespace.window_title)
        self.root.resizable(*self.pp.namespace.window_resizable)
        self.root.iconphoto(True, self.pp.namespace.window_icon.tk_photo_image)
        self.window = Window(self.root, self.pp)
        self.window.pack(expand=True, fill=tk.BOTH)

    def start(self):
        self.window.redraw()
        self.root.mainloop()

    def update_location(self):
        w = self.pp.namespace.width
        h = self.pp.namespace.height
        x, y = self.pp.namespace.window_offset
        geometry = f"{w + 2}x{h + 20}+{x}+{y}"
        self.pp.logger.info('Updating window with geometry %s', geometry)
        self.root.geometry(geometry)

    def update_size(self):
        self.update_location()

    def update_title(self):
        self.root.title(self.pp.namespace.window_title)

    def update_resizable(self):
        self.root.resizable(self.pp.namespace.window_resizable)

    def update_icon(self):
        self.root.iconphoto(True, self.pp.namespace.window_icon.tk_photo_image)

    def set_cursor(self, cursor_type):
        cursors = ('arrow', 'crosshair', 'hand1', 'fleur', 'xterm', 'circle')
        self.window.canvas.config(cursor=cursors[cursor_type])

    def disable_cursor(self):
        self.window.canvas.config(cursor='none')
Exemplo n.º 5
0
class TkRenderer:
    def __init__(self, pyprocessing):
        self.pp = pyprocessing
        self.root = None
        self.window = None
        self.this = self

    def init(self):
        self.root = tk.Tk()
        w = self.pp.namespace.width
        h = self.pp.namespace.height
        x, y = self.pp.namespace.window_offset
        geometry = f"{w + 2}x{h + 20}+{x}+{y}"
        self.pyprocessing.logger.info('Initializing window with geometry %s',
                                      geometry)
        self.root.geometry(geometry)
        self.root.title(self.pp.namespace.window_title)
        self.root.resizable(self.pp.namespace.window_resizable)
        self.root.iconphoto(True, self.pp.namespace.window_icon.tk_photo_image)
        self.window = Window(self.root, self.pyprocessing)
        self.window.pack(expand=True, fill=tk.BOTH)

    def start(self):
        self.window.redraw()
        self.root.mainloop()

    def update_location(self):
        w = self.pp.namespace.width
        h = self.pp.namespace.height
        x, y = self.pp.namespace.window_offset
        geometry = f"{w + 2}x{h + 20}+{x}+{y}"
        self.pyprocessing.logger.info('Updating window with geometry %s',
                                      geometry)
        self.root.geometry(geometry)

    def update_size(self):
        self.update_location()

    def update_title(self):
        self.root.title(self.pp.namespace.window_title)

    def update_resizable(self):
        self.root.resizable(self.pp.namespace.window_resizable)

    def update_icon(self):
        self.root.iconphoto(True, self.pp.namespace.window_icon.tk_photo_image)
Exemplo n.º 6
0
class TkRenderer:
    def __init__(self, pyprocessing):
        self.pyprocessing = pyprocessing
        self.root = None
        self.window = None

    def init(self):
        self.root = tk.Tk()
        w = self.pyprocessing.width
        h = self.pyprocessing.height
        geometry = f"{w + 2}x{h + 20}+20+20"
        self.pyprocessing.logger.info('Initializing window with geometry %s',
                                      geometry)
        self.root.geometry(geometry)
        self.root.title()
        self.root.resizable(False, False)
        self.window = Window(self.root, self.pyprocessing)
        self.window.pack(expand=True, fill=tk.BOTH)

    def start(self):
        self.window.redraw()
        self.root.mainloop()
Exemplo n.º 7
0
class TkRenderer:
    def __init__(self, pyprocessing):
        self.pyprocessing = pyprocessing
        self.root = None
        self.window = None

    def init(self):
        self.root = tk.Tk()
        w = self.pyprocessing.width
        h = self.pyprocessing.height
        self.root.geometry(f"{w + 2}x{h + 20}+20+20")
        self.root.title()
        self.window = Window(self.root, self.pyprocessing.namespace,
                             self.pyprocessing.draw)
        self.window.pack(expand=True, fill=tk.BOTH)

    def start(self):
        self.window.redraw()
        print(self.window.winfo_width(), self.window.winfo_height())
        print(self.window.canvas.winfo_width(),
              self.window.canvas.winfo_height())
        self.root.mainloop()