frame $self.top
label $self.l -text "Pattern:"
entry $self.e -width 40 -relief sunken
+ bind $self.e <Return> "$self add_pattern"
pack $self.l -in $self.top -side left
pack $self.e -in $self.top -side left -fill x
pack $self.top -side top -fill x -pady .25c
pack $self.lframe -in $self -side right -fill both -expand yes
set title "Edit [$slot(list) cget -title] Filter"
wm title $self $title
- wm iconname $self $title
foreach pat [$slot(list) cget -patterns] {
$self.list insert end $pat
lappend slot(patterns) $pat
pack $self.go $self.reset $self.close -side left
set title "Find in [$slot(list) get_item_name] List..."
wm title $self $title
- wm iconname $self $title
focus $self.e
$slot(list) reset_search
}
}
}
+dialog list_show {
+ param list
+ method create {} {
+ frame $self.top
+ pack $self.top -side top -fill x
+ label $self.l -text "Show:"
+ entry $self.e -bd 2 -relief sunken
+ bind $self.e <Return> "$self show"
+ pack $self.l -in $self.top -side left
+ pack $self.e -in $self.top -fill x -expand 1
+ button $self.show -text "Show" -command "$self show"
+ button $self.close -text "Close" -command "destroy $self"
+ pack $self.show $self.close -side left
+ wm title $self "Show a [$slot(list) get_item_name]"
+ focus $self.e
+ }
+ method reconfig {} {
+ }
+ method show {} {
+ set item [$self.e get]
+ $slot(list) run_command $item
+ wm withdraw $self
+ }
+}
+
widget tkinspect_list {
param command {}
param title {}
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)]
- $slot(menu) add command -label "Find..." \
+ $slot(menu) add command \
+ -label "Show a [$self get_item_name]..." -underline 0 \
+ -command "$self show_dialog"
+ $slot(menu) add command -label "Find $slot(title)..." -underline 0 \
-command "$self search_dialog"
- $slot(menu) add command -label "Edit Filter..." \
+ $slot(menu) add command -label "Edit Filter..." -underline 0 \
-command "$self edit_filter"
- $slot(menu) add command -label "Remove List" \
+ $slot(menu) add command -label "Remove List" -underline 0 \
-command "$self remove"
}
method reconfig {} {
$self reset_search
}
}
+ method show_dialog {} {
+ if ![winfo exists $self.show] {
+ list_show $self.show -list $self
+ center_window $self.show
+ } else {
+ wm deiconify $self.show
+ }
+ }
}