From bc922b6a530c174a99691035f45e3fb50d665840 Mon Sep 17 00:00:00 2001 From: sls Date: Sun, 4 Jun 1995 08:06:33 +0000 Subject: [PATCH] Add trigger method and binding for space so keyboard usage works. --- lists.tcl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lists.tcl b/lists.tcl index c5afebd..f42b9a7 100644 --- a/lists.tcl +++ b/lists.tcl @@ -148,6 +148,7 @@ widget tkinspect_list { listbox $self.list -relief sunken -exportselection 0 \ -yscroll "$self.sb set" -selectmode single bind $self.list <1> "$self click %x %y; continue" + bind $self.list "$self trigger; continue" pack $self.sb -side right -fill y pack $self.list -side right -fill both -expand yes set slot(menu) [$slot(main) add_menu $slot(title)] @@ -202,6 +203,11 @@ widget tkinspect_list { method click {x y} { $self run_command [$self.list get @$x,$y] } + method trigger {} { + set selection [$self.list curselection] + if ![llength $selection] return + $self run_command [$self.list get [lindex $selection 0]] + } method run_command {item} { if [string length $slot(command)] { set slot(current_item) $item -- 2.23.0