-
Notifications
You must be signed in to change notification settings - Fork 2
/
view_tkinter.py
54 lines (47 loc) · 1.07 KB
/
view_tkinter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/python
import tkinter as tk
from tkinter import *
import tkinter.messagebox
class App(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.pack()
# create the application
myapp = App()
#
# here are method calls to the window manager class
#
myapp.master.title("My Do-Nothing Application")
myapp.master.geometry("320x200")
myapp.master.maxsize(1000, 400)
myapp.master.configure(background='black')
def helloCallBack():
tkinter.messagebox.showinfo( "Hello Python", "Hello World")
#
B = tkinter.Button(myapp, text ="Hello", background='black', command = helloCallBack)
B.pack()
# start the program
myapp.mainloop()
#
#
# TK_SILENCE_DEPRECATION=1
#
# def clickExitButton(top):
# exit()
#
#
# top = tkinter.Tk()
#
# def helloCallBack():
# tkinter.messagebox.showinfo( "Hello Python", "Hello World")
#
# B = tkinter.Button(top, text ="Hello", command = helloCallBack)
# # exitButton = tkinter.Button(top, text="Exit", command=clickExitButton(top))
#
#
# # exitButton.place(x=0, y=0)
#
# B.pack()
# # exitButton.pack()
#
# top.mainloop()