@@ -12,7 +12,7 @@ b.grid(column=2, row=2)
12
12
root.mainloop()
13
13
```
14
14
15
- ![ #1 ] ( images/main-1 .png?raw=true )
15
+ ![ #1 ] ( images/main-01 .png?raw=true )
16
16
17
17
---
18
18
@@ -28,7 +28,7 @@ b.grid(column=2, row=2)
28
28
root.mainloop()
29
29
```
30
30
31
- ![ #1 ] ( images/main-2 .png?raw=true )
31
+ ![ #1 ] ( images/main-02 .png?raw=true )
32
32
33
33
---
34
34
@@ -48,7 +48,7 @@ b.grid(column=2, row=2)
48
48
root.mainloop()
49
49
```
50
50
51
- ![ #1 ] ( images/main-3 .png?raw=true )
51
+ ![ #1 ] ( images/main-03 .png?raw=true )
52
52
53
53
---
54
54
@@ -69,7 +69,7 @@ b.grid(column=2, row=2)
69
69
root.mainloop()
70
70
```
71
71
72
- ![ #1 ] ( images/main-4 .png?raw=true )
72
+ ![ #1 ] ( images/main-04 .png?raw=true )
73
73
74
74
---
75
75
@@ -90,7 +90,7 @@ b.grid(column=2, row=2)
90
90
root.mainloop()
91
91
```
92
92
93
- ![ #1 ] ( images/main-5 .png?raw=true )
93
+ ![ #1 ] ( images/main-05 .png?raw=true )
94
94
95
95
---
96
96
@@ -111,7 +111,7 @@ b.grid(column=2, row=2)
111
111
root.mainloop()
112
112
```
113
113
114
- ![ #1 ] ( images/main-6 .png?raw=true )
114
+ ![ #1 ] ( images/main-06 .png?raw=true )
115
115
116
116
---
117
117
@@ -132,8 +132,82 @@ b.grid(column=2, row=2)
132
132
root.mainloop()
133
133
```
134
134
135
- | with <br />` geometry() ` | without <br />` geometry() ` |
135
+ | without <br />` geometry() ` | with <br />` geometry('300x300') ` |
136
136
| --- | --- |
137
- | ![ #1 ] ( images/main-5.png?raw=true ) | ![ #1 ] ( images/main-3.png?raw=true ) |
137
+ | ![ #1 ] ( images/main-03.png?raw=true ) | ![ #1 ] ( images/main-05.png?raw=true ) |
138
+
139
+ ---
140
+
141
+ ``` python
142
+ import tkinter as tk
143
+
144
+ root = tk.Tk()
145
+ root.minsize(width = 600 , height = 0 )
146
+
147
+ root.columnconfigure(1 , minsize = 50 , weight = 1 )
148
+ root.columnconfigure(3 , minsize = 50 , weight = 1 )
149
+ root.rowconfigure(1 , minsize = 50 , weight = 1 )
150
+ root.rowconfigure(3 , minsize = 50 , weight = 1 )
151
+
152
+ b = tk.Button(root, text = " Exit" , command = root.destroy)
153
+ b.grid(column = 2 , row = 2 )
154
+
155
+ root.mainloop()
156
+ ```
157
+
158
+ ![ #1 ] ( images/main-07.png?raw=true )
159
+
160
+ ---
161
+
162
+ ``` python
163
+ import tkinter as tk
164
+
165
+ root = tk.Tk()
166
+ root.geometry(' 300x300' )
167
+
168
+ root.columnconfigure(1 , weight = 1 )
169
+ root.columnconfigure(3 , minsize = 25 ) # weight=0
170
+ root.rowconfigure(1 , weight = 1 )
171
+ root.rowconfigure(3 , minsize = 25 ) # weight=0
172
+
173
+ b = tk.Button(root, text = " Exit" , command = root.destroy)
174
+ b.grid(column = 2 , row = 2 )
175
+
176
+ root.mainloop()
177
+ ```
178
+
179
+ | at start |
180
+ | --- |
181
+ | ![ #1 ] ( images/main-08.png?raw=true ) |
182
+
183
+ | resized (using mouse) |
184
+ | --- |
185
+ | ![ #1 ] ( images/main-09.png?raw=true ) |
186
+
187
+ ---
188
+
189
+ ``` python
190
+ import tkinter as tk
191
+
192
+ root = tk.Tk()
193
+ root.geometry(' 800x50' )
194
+
195
+ root.columnconfigure(1 , weight = 1 )
196
+ root.columnconfigure(2 , weight = 4 )
197
+ root.columnconfigure(3 , weight = 8 )
198
+
199
+ b1 = tk.Button(root, text = " Col 1" )
200
+ b1.grid(column = 1 , row = 1 , stick = ' we' )
201
+
202
+ b2 = tk.Button(root, text = " Col 2" )
203
+ b2.grid(column = 2 , row = 1 , stick = ' we' )
204
+
205
+ b3 = tk.Button(root, text = " Col 3" )
206
+ b3.grid(column = 3 , row = 1 , stick = ' we' )
207
+
208
+ root.mainloop()
209
+ ```
210
+
211
+ ![ #1 ] ( images/main-10.png?raw=true )
138
212
139
213
0 commit comments