From 5139563d16c5f987ab5333a4a319a4f9cee77840 Mon Sep 17 00:00:00 2001 From: sls Date: Wed, 15 Feb 1995 02:59:04 +0000 Subject: [PATCH] Make return in filter_editor add a pattern. Add list_show dialog. Add underlines. --- lists.tcl | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/lists.tcl b/lists.tcl index af9670b..55fc9f3 100644 --- a/lists.tcl +++ b/lists.tcl @@ -10,6 +10,7 @@ dialog filter_editor { frame $self.top label $self.l -text "Pattern:" entry $self.e -width 40 -relief sunken + bind $self.e "$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 @@ -38,7 +39,6 @@ dialog filter_editor { 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 @@ -88,7 +88,6 @@ dialog list_search { 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 } @@ -104,6 +103,31 @@ dialog list_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 "$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 {} @@ -126,11 +150,14 @@ widget tkinspect_list { 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 {} { @@ -232,4 +259,12 @@ widget tkinspect_list { $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 + } + } } -- 2.23.0