Tap to unmute

The tkinter combobox and spinbox widgets

  Рет қаралды 6,608

Atlas

Atlas

Күн бұрын

Пікірлер: 3
@cocogswy
@cocogswy Жыл бұрын
for CTk the event for comboboxes doesn't work.. I fixed this by creating this callback function and putting it in the "command=callback" of the combobox def callback(choice): food_string.set(choice) combolabel.configure(text = f"Selected value: {food_string.get()}") Just for people that are following this tutorial but are using customtkinter. Love your content tho! verry helpfull
@mokasurvey
@mokasurvey Жыл бұрын
the code plssss🙏🙏🙏
@garmrdmr
@garmrdmr Жыл бұрын
um.. this is the first time i dont quite agree... we are not Done.... on the spinbox when you press down it prints the value it WAS, but the spinbox changes to a different value for example... it shows a 'C'.. press down The spin box changes to 'B' but it Prints 'C' it is printing the value it is changing from - you can see this on your screen example too but, because yo do it so quick it is not obvious this only seems to happen when using the events - the event is triggering, it seems, when the down is pressed - BEFORE the box chanegs value - after processing the event . THEN the spinbox make sthe change to eth variable... OUCH if i just use command=... then the function gets processed, apparently, AFTER the spin box value is changed - and so the screen and print statement align this code shows it VERY clearly - the command label always shows the same as the spinbox. But the event label is always "one behind" import tkinter as tk from tkinter import ttk window = tk.Tk() window.geometry('800x600') def sLabelUpdate(): commandLabel.configure(text=f'command triggers : {spin_string.get()}') spin_string = tk.StringVar() values = ['A', 'B', 'C', 'D', 'E'] commandLabel = ttk.Label(window, text="...") commandLabel.pack() spin = ttk.Spinbox( window, textvariable=spin_string, values=values, command = sLabelUpdate ) spin.pack() spinEventLabel = ttk.Label(window, text='...') spinEventLabel.pack() spin.bind('', lambda event: spinEventLabel.configure(text=f'event triggers : {spin_string.get()}')) spin.bind('', lambda event: spinEventLabel.configure(text=f'event triggers : {spin_string.get()}')) tk.mainloop()
creating tables in tkinter with the treeview widget
14:44
The place layout method in tkinter
20:50
Atlas
Рет қаралды 9 М.
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
toggle widgets
16:22
Atlas
Рет қаралды 3,8 М.
Dead Simple GUI (Immediate Mode)
15:31
Stian
Рет қаралды 2,5 М.
Introducing Clay - High Performance UI Layout in C
35:19
Nic Barker
Рет қаралды 215 М.
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 172 М.
Tkinter tutorial for beginners #5: Combobox, Listbox
21:36
Code First with Hala
Рет қаралды 11 М.
Using menus in tkinter
19:00
Atlas
Рет қаралды 16 М.
The pack layout method in tkinter
23:50
Atlas
Рет қаралды 17 М.