(Sep-29-2020, 03:24 PM)Larz60+ Wrote: please show enough code so that we can run it.
from tkinter import * from tkinter import ttk root = Tk() def print_me(): selected_items = listbox.curselection() for item in selected_items: print(listbox.get(item)) def delete_me(): selected_items = listbox.curselection() for item in selected_items: listbox.delete(item) def add_me(): selected_items = listbox.curselection() for item in selected_items: listbox.insert(END, item) print(item, 'is added') listbox = Listbox(root, width = 40, height = 15, selectmode = MULTIPLE) listbox.insert(0, 'Python') listbox.insert(1, 'C++') listbox.insert(2, 'C#') listbox.insert(3, 'PHP') listbox.pack(pady = 25) btn = Button(root, text = 'Print', command = print_me).place(x = 200, y = 300) btn2 = Button(root, text = 'Delete', command = delete_me).place(x = 300, y = 300) btn3 = Button(root, text = 'Add', command = add_me).place(x = 400, y = 300) root.geometry('650x450+650+350') root.mainloop()