Beispiel #1
0
def main():
    def on_closing():
        if ctrl.isNoteModified():
            if messagebox.askyesno("Quit",
                                   "Do you want to quit?\nNote is modified."):
                root.destroy()
        else:
            root.destroy()

    root = Tk()
    root.protocol("WM_DELETE_WINDOW", on_closing)
    scriptpath = os.path.realpath(__file__)
    imagepath = scriptpath.replace("main.py", "images/notes.png")
    icon = PhotoImage(file=imagepath)
    root.call('wm', 'iconphoto', root._w, icon)
    root.title("Notes")
    root.rowconfigure(0, weight=1)
    root.columnconfigure(0, weight=1)
    f = MainFrame(root)
    f.grid(row=0, column=0, sticky='nswe', padx=3, pady=3)

    ctrl = Controller(f)
    ctrl.startWork()

    root.option_add('*Dialog.msg.font', 'Helvetica 11')

    root.mainloop()

    ctrl.endWork()
Beispiel #2
0
def testFont():
    root = Tk()
    root.title("Finally Pycharm working with tkinter")
    available = families()
    print(len(available))
    print("availabe: ", available)
    f = MainFrame(root)
    f.grid(row=0, column=0)

    root.mainloop()