Skip to content

Commit e58816b

Browse files
committed
Add notes on Entry, Frame
1 parent d6bef6b commit e58816b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

tk_tutorial/tk.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# create an instance of the tk.Tk class => this creates the application window
77
root = tk.Tk()
8-
root.config(background="yellow")
8+
root.config(background="lightblue")
99
root.title("First tutorial with Tkinter")
1010
# root.geometry("600x400-30+150")
1111

@@ -60,8 +60,6 @@ def download_clicked():
6060
expand=True
6161
)
6262

63-
root.mainloop()
64-
6563
# call the mainloop() method of the main window object => this keeps the window
6664
# visible on the screen and keeps it running until you close it (use it as last
6765
# statement in the programme)

tkinter_notes.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,17 @@ password_entry = ttk.Entry(
177177
show='*'
178178
)
179179
password_entry.pack()
180-
``
180+
```
181+
182+
**Frame**
183+
A frame is a widget that displays as a simple rectangle. Typically, you use a frame to organize other widgets both visually and at the coding level.
184+
185+
To create a frame, use the ttk.Frame class: `frame = ttk.Frame(container, **options)`
186+
187+
* **frame size**: the frame takes on the size of its content (the size and layout of the widgets it contains)
188+
* set the frame size: `frame = ttk.Frame(container, height, width)`
189+
* **padding**: add extra space (in pixels) around the inside of the frame, any side that is required with `frame['padding'] = (left, top, right, bottom)`
190+
*
181191

182192

183193
**Messagebox**

0 commit comments

Comments
 (0)