listbox

Tkinter weird listbox behavior

Tkinter weird listbox behavior Question: def possibleClicked(stuff): selectedItem = listbox.get(listbox.curselection()) print(selectedItem) listbox.delete(listbox.curselection()) listbox2.insert(tkinter.END, selectedItem) listbox.selection_clear(0, tkinter.END) root = customtkinter.CTk() root.geometry("650×400") root.title("Bazaar Bot – Login") root.resizable(False, False) listbox = tkinter.Listbox(root, selectmode=tkinter.SINGLE, exportselection=False, width=15, height=10) listbox.place(x=400,y=30) listbox.bind("<<ListboxSelect>>", possibleClicked) for i in settings.possible: listbox.insert(tkinter.END, i) In the gif below, I’m spam clicking and the listbox elements do not …

Total answers: 2

tkinter listbox selected style to transparent

tkinter listbox selected style to transparent Question: I have a tkinter Listbox containing dynamic int valuesfor example [1,2,3,4,5]. I have adapted my code to make it simpler. self.edt_shots = ttk.Listbox( self, height=7, exportselection=False, selectforeground="purple", activestyle=UNDERLINE, #selectbackground="white", # TRANSPARENT needed here? ) self.edt_shots.grid(row=3, column=3, rowspan=5) I do some conditional formatting on the background of each item. …

Total answers: 1

Python – how to remove border around selected ListBox item?

Python – how to remove border around selected ListBox item? Question: This is a minor issue but I’ve been struggling with it most of the afternoon and getting nowhere, so here goes. I’m about to write a Python script that will require the use of the ScrolledListBox(). Never having used it before, I started with …

Total answers: 1

How to avoid tkinter <<ListboxSelect>> and .curselection() detecting events/selection outside of Listbox?

How to avoid tkinter <<ListboxSelect>> and .curselection() detecting events/selection outside of Listbox? Question: I am using the following tkinter widgets: Entry and Listbox. I want the Entry widget to display a selected item in the Listbox The Listbox is configured to allow selectmode=tk.SINGLE. Selection is triggered by tkinter built-in virtual event <<ListboxSelect>>. My test script …

Total answers: 1

Python equivalent for C#'s generic List<T>

Python equivalent for C#'s generic List<T> Question: I am creating a simple GUI program to manage priorities. I have successfully managed to add functionality to add an item to the listbox. Now I want to add the item to the something what is known as List<> in C#. Does such a thing exist in Python? …

Total answers: 2