in reply to How to set a default Listbox selection

If you'd like an element to be selected, then you should select it. From Tk::Listbox:
$listbox->selectionSet(first, ?last?)

Selects all of the elements in the range between first and last, inclusive, without affecting the selection state of elements outside that range.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

  • Comment on Re: How to set a default Listbox selection

Replies are listed 'Best First'.
Re: How to set a default Listbox selection
by Anonymous Monk on Feb 19, 2016 at 17:43 UTC
    Thanks! That was surprisingly easy! I tried that (and other methods) multiple times the other day with no luck. I must have been missing something in the syntax or just had a typo.