in reply to Tk::ListBox questions
Well a single or double click on an enabled list doesn't do much, until you bind the double click
As far as the single click selection goes, it is deeply built into the Listbox widget. You may be able to subclass the Listbox, and redefine what a single click does, search groups.google for " perl tk listbox derived". But the easiest thing, may be to change the various color options, so that "it appears" they are not doing anything, and just discard any selections. In other words, have the selected color set to be the same as the unselected color. Otherwise, it may be better to choose a different widget.$lb -> bind("<Double-Button-1>",\&display); sub display { $selected = $lb -> get($lb -> curselection); $message = "You selected: $selected \n"; print "you chose $selected\n"; $lb->selectionClear(0, 'end'); }
|
|---|