Update README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
59c853602e
commit
06a23edb01
1 changed files with 11 additions and 16 deletions
|
@ -368,35 +368,30 @@ from tkinter import ttk
|
||||||
|
|
||||||
|
|
||||||
def changed() -> None:
|
def changed() -> None:
|
||||||
print("Changed")
|
global my_frame
|
||||||
|
|
||||||
|
print(f"Changed {my_frame.get()}")
|
||||||
|
|
||||||
|
|
||||||
root = tk.Tk()
|
root = tk.Tk()
|
||||||
|
|
||||||
number_of_patches: int = 10
|
|
||||||
width_label: int = 20
|
|
||||||
width_element: int = 10
|
width_element: int = 10
|
||||||
|
height_element: int = 100
|
||||||
|
|
||||||
row_id: int = 0
|
InitialIndex: int = 10
|
||||||
column_id: int = 0
|
|
||||||
|
|
||||||
frame = ttk.LabelFrame(root, text="Spin Box")
|
values: list = list(f"{x:d}" for x in range(1, 301))
|
||||||
frame.grid(row=row_id, column=column_id, sticky="nw", pady=5)
|
|
||||||
|
|
||||||
label_number_of_patches = ttk.Label(frame, text="SpinBox Text", width=width_label)
|
my_frame = ttk.Spinbox(
|
||||||
label_number_of_patches.grid(row=0, column=0, sticky="w")
|
root,
|
||||||
|
|
||||||
spinbox_number_of_patches = ttk.Spinbox(
|
|
||||||
frame,
|
|
||||||
values=list(f"{x:d}" for x in range(1, 301)),
|
|
||||||
width=width_element,
|
width=width_element,
|
||||||
|
values=values,
|
||||||
command=changed,
|
command=changed,
|
||||||
)
|
)
|
||||||
spinbox_number_of_patches.grid(row=0, column=1, sticky="w")
|
my_frame.grid(row=0, column=0, sticky="w")
|
||||||
spinbox_number_of_patches.set(number_of_patches)
|
my_frame.set(InitialIndex)
|
||||||
|
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
|
|
||||||
del root
|
del root
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue