Hi Vasilis, try exportselection=False
Regards Michael On Mon, 9 Mar 2015 15:01:35 +0000 Vasilis Vlachoudis <vasilis.vlachou...@cern.ch> wrote: > Dear all, > > how can I keep the listbox selection persistent when user selects > something in the entry? In the following example, the rows 0 to 10 are > selected in the listbox If you click and select something in the entry > box the selection is lost Is there an option to avoid this behaviour? > > Best Regards > Vasilis > > from Tkinter import * > tk = Tk() > > listbox = Listbox(tk, selectmode=EXTENDED, exportselection=True) > listbox.pack(fill=BOTH, expand=YES) > for i in range(100): listbox.insert(END,"line %d"%(i)) > listbox.selection_set(0,10) > > entry = Entry(tk) > entry.pack(side=BOTTOM, fill=X) > entry.insert(0,"Hello world") > tk.mainloop() .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. You speak of courage. Obviously you do not know the difference between courage and foolhardiness. Always it is the brave ones who die, the soldiers. -- Kor, the Klingon Commander, "Errand of Mercy", stardate 3201.7 _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss