Jun-26-2018, 03:44 PM
Hi pad
One way to start:
One way to start:
# -*- coding: utf-8 -*- try: import Tkinter as tk import ttk except ImportError: import tkinter as tk from tkinter import ttk APP_TITLE = "My App" APP_XPOS = 100 APP_YPOS = 100 APP_WIDTH = 300 APP_HEIGHT = 200 class Progress(object): def __init__(self, my_app): self.my_app = my_app def creat(self): print("create") def plus(self) : print("plus") def kill (self): print("kill") class MyBeginnersApp(object): def __init__(self, app_win): self.app_win = app_win self.main_frame = tk.Frame(app_win) self.main_frame.pack(fill='both', expand=True, padx=10, pady=10) self.progress = Progress(self) self.build() def build(self): button_frame = tk.Frame(self.main_frame) button_frame.pack(expand=True, padx=4, pady=4) tk.Button(button_frame, text="run", command=self.progress.creat).pack(fill='x') tk.Button(button_frame, text="+++", command=self.progress.plus).pack(fill='x') tk.Button(button_frame, text="update", command=self.update).pack(fill='x') tk.Button(button_frame, text="kill", command=self.progress.kill).pack(fill='x') tk.Button(button_frame, text="Quit", command=quit).pack(fill='x') def update(self): print("update") def main(): app_win = tk.Tk() app_win.title(APP_TITLE) app_win.geometry("+{}+{}".format(APP_XPOS, APP_YPOS)) #app_win.geometry("{}x{}".format(APP_WIDTH, APP_HEIGHT)) app = MyBeginnersApp(app_win) app_win.mainloop() if __name__ == '__main__': main()wuf ;-)