| Description: |
I am having a problem binding the double click event to
a tk listbox
which is embedded in BWidget frames. The code works in
KDE and in a
VNC viewer, however. When I double-click, it does
nothing but highlight the selected item
in the listbox. When I change the binding event in my
code to
single-click, it works correctly, however. I tried to move
the custom
bindtag before the class bindings, however I'm receiving
the same
behavior.
Code snippet ...
...
...
#! /usr/bin/wish
set rt [catch {set version [package require BWidget]}
err]
if {$rt != 0 } {
tk_messageBox -icon error -type ok -title "Missing
BWidgets" -message
\
"Missing BWidgets package."
exit
}
set tlist [list "element1" "element2"]
set mainframe [MainFrame .mainframe]
# NoteBook creation
set frame [$mainframe getframe]
set notebook [NoteBook $frame.nb]
# Create Top-level tab frames
set components_frame [$notebook insert end tab1 -
text "Tab1"]
# Create subordinate tab frames
set components_nb [NoteBook
$components_frame.components_nb]
set frame [$components_nb insert end tab2 -text "Tab2"]
set topf [frame $frame.topf]
# Paned Windows
set pw1 [PanedWindow $topf.pw -side top]
set pane [$pw1 add ]
set pw2 [PanedWindow $pane.pw -side left]
set tpane [$pw2 add -weight 3]
# Major subframes
set tbox [TitleFrame $tpane.tbox -text "Widgets"]
# Placing layout frames and major subframes
pack $tbox -padx 2 -side left -fill both -expand yes
pack $pw1 -fill both -expand yes
pack $pw2 -fill both -expand yes
pack $topf -fill both -expand yes
# Types listbox
set sw_t [ScrolledWindow [$tbox getframe].sw -
auto both]
set tlistbox [listbox [$sw_t getframe].lb -height 18 -
width 20 \
-highlightthickness 0 -listvar ::tlist]
$sw_t setwidget $tlistbox
bindtags $tlistbox [linsert [bindtags $tlistbox] 3
tlist_Tag]
bind tlist_Tag <Double-Button-1> {puts HI}
pack $sw_t -fill both -expand yes
$notebook compute_size
pack $notebook -fill both -expand yes -padx 4 -pady 4
$notebook raise [$notebook page 0]
$components_nb compute_size
pack $components_nb -fill both -expand yes -padx 4 -
pady 4
$components_nb raise [$components_nb page 0]
pack $mainframe -fill both -expand yes
|