Skip to content

Commit d6bef6b

Browse files
committed
Update layout notes.md file
1 parent 4013344 commit d6bef6b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tkinter_notes.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Tkinter is the built-in Python module that is used to create GUI (graphical user
1111
* `options` is keyword/s argument/s that specify configuration of the widget
1212
* example: `message = tk.Label(root, text = "Hello World!")` => this creates a `label` widget that is placed on the `root` window
1313
* to make the label visible, use the `pack()` method: `message.pack()`
14+
---
1415

1516
Widgets | Description
1617
------- | -----------
@@ -167,10 +168,16 @@ textbox = ttk.Entry(root, textvariable=text)
167168

168169
You can place move the **focus** to the first Entry widget after the window appears. Once the Entry widget has focus, it’s ready to accept the user input. To do it, you use the `focus()` method of the Entry widget like this: `textbox.focus()`.
169170

170-
171-
172-
173-
171+
To hide **sensitive information** on the Entry widget e.g., a password, you can use the show option. The following creates a password entry. When you enter a password, it doesn’t show the actual characters but the asterisks (*) specified in the show option:
172+
```py
173+
password = tk.StringVar()
174+
password_entry = ttk.Entry(
175+
root,
176+
textvariable=password,
177+
show='*'
178+
)
179+
password_entry.pack()
180+
``
174181

175182

176183
**Messagebox**

0 commit comments

Comments
 (0)