-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path134 tkinter-test.py
41 lines (31 loc) · 1.12 KB
/
134 tkinter-test.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
import tkinter
print(tkinter.TkVersion)
print(tkinter.TclVersion)
mainWindow = tkinter.Tk()
mainWindow.title("HelloWorld")
mainWindow.geometry("640x480-8-200")
label = tkinter.Label(mainWindow, text="Hello")
label.grid(row=0, column=0)
leftFrane = tkinter.Frame(mainWindow)
leftFrane.grid(row=1, column=1)
canvas = tkinter.Canvas(mainWindow, relief="raised", borderwidth=1)
canvas.grid(row=1, column=0)
rightFrane = tkinter.Frame(mainWindow)
rightFrane.grid(row=1, column=2, sticky="n")
button1 = tkinter.Button(rightFrane, text="Przycisk 1")
button2 = tkinter.Button(rightFrane, text="Przycisk 2")
button3 = tkinter.Button(rightFrane, text="Przycisk 3")
button1.grid(row=0, column=0)
button2.grid(row=1, column=0)
button3.grid(row=2, column=0)
#configure the columns
mainWindow.columnconfigure(0, weight=1)
mainWindow.columnconfigure(1, weight=1)
mainWindow.grid_columnconfigure(2, weight=1)
leftFrane.config(relief="sunken", borderwidth=1)
rightFrane.config(relief="sunken", borderwidth=1)
leftFrane.grid(sticky="ns")
rightFrane.grid(sticky="new")
rightFrane.columnconfigure(0, weight=1)
button2.grid(sticky="ew")
mainWindow.mainloop()