Preselect Item(s) in a Listbox

35 views
Skip to first unread message

JaMeAs YaMeAs J.B. PRANCER

unread,
Jun 2, 2020, 2:30:27 PM6/2/20
to Tk Documentation and Resources
Hey,
is it possible to 'preselect' an item in a listbox? like when you run the app, an item is already selected?

I am writing a game, and it has a setup menu, so you can alter you screen resolution, borders, etc. it writes the users selections to a config file, and the next time it is run, enters the users (or default) selections to the listbox(s). I can't find a command or way to 'preselect' an option in a list box, am i missing something or has this feature just impossible right now...

thanks.

Jonathan Lahav

unread,
Jun 10, 2020, 4:30:29 AM6/10/20
to Tk Documentation and Resources
Sure.

listbox.selection_set(<number>)
Reply all
Reply to author
Forward
0 new messages