Simulating "effects" of a mouseclick with a TK Listbox

Posted by ragnakore on 2015-01-14 05:31

I have a TK ListBox as shown:

$GUI{'2.8'} = $GUI{'0.0'}->Scrolled(
-selectmode => "browse",
-bg => "#C0C0C0",
-fg => "#000000",
-scrollbars => 'e',
-cursor => 'left_ptr',
$GUI{'2.8'}->bind( '', sub {


When I click on a line in the ListBox, it will be highlighted with a "#C0C0C0" background color. Likewise, a corresponding Bind event will be triggered to process the activity.

Here are the Questions:
1. Is it possible to simulate a click on any line in the Listbox such that, it will change the background color and call the binding event routing without using "Mouse Move and Click"?

2. If I have multiple Listboxes, I can only highlight one Listbox; all the other Listboxes gets unhighlighted. How do I make it be able to highlight (change the background color) multiple Listboxes?