diff options
-rwxr-xr-x | src/ivymon | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -601,7 +601,7 @@ $searchEntry->eventAdd('<<SearchNextExpr>>', '<Down>', '<Control-n>'); $searchEntry->eventAdd('<<SearchPrevExpr>>', '<Up>', '<Control-p>'); $searchEntry->bind('<<SearchNext>>' => [\&searchNext, 1]); -$searchEntry->bind('<<SearchPrev>' => [\&searchPrev, 1]); +$searchEntry->bind('<<SearchPrev>>' => [\&searchPrev, 1]); $searchEntry->bind('<<SearchNextExpr>>' => [\&searchNextExpression]); $searchEntry->bind('<<SearchPrevExpr>>' => [\&searchPrevExpression]); $searchEntry->bind('<Key>' => [\&searchOnTheFly]); @@ -1086,15 +1086,21 @@ sub filterClient { )->pack(-side => 'top', -fill => 'both', -expand => 1); - $clientsMessagesTpl{$client}->bind('<1>', - sub {$clientsMessagesTpl{$client}->focus;}); + $clientsMessagesTpl{$client}->bind('<1>', sub { + $clientsMessagesTpl{$client}->Subwidget('scrolled')->focus;}); &wheelmousebindings($clientsMessagesTpl{$client}); $tpl->Button(-text => 'Close', - -command => [sub { $clientsMessagesTpl{$client} = undef; - $tpl->destroy; - }], + -command => [sub { + my $text = $clientsMessagesTpl{$client}->Subwidget('scrolled'); + if ($focusedtext eq $text) { + $focusedtext = $messagesText; + $messagesText->focus; + } + $clientsMessagesTpl{$client} = undef; + $tpl->destroy; + }], )->pack(-side => 'top', -padx => 10, -pady => 10); @@ -1301,8 +1307,6 @@ sub afterUpdatingMessages { sub highlightString { my ($i1, $i2) = @_; - # hidden data - print "focusedtext=$focusedtext\n"; $focusedtext->tagConfigure('found', -background => 'sienna', -foreground => 'ivory'); @@ -1705,8 +1709,7 @@ sub searchPrevExpression { sub clearSearch { - # on vide la le champ de saisie - $searchEntry->delete(0, 'end'); + #$searchEntry->delete(0, 'end'); &highlightStringOff; $searchIndex = undef; $searchString = undef; @@ -1742,7 +1745,7 @@ sub searchOnTheFly { push(@searchopts, -nocase) unless ($casesensitiveflag); push(@searchopts, -regexp) if ($regexpflag); my $index = $focusedtext->search(@searchopts, $string, $index0); - print "index=$index strlen=$strlen\n"; + #print "index=$index strlen=$strlen\n"; if ($index) { &highlightStringOff if $searchString and $string eq $searchString; $searchString = $focusedtext->get($index, "$index + $strlen chars"); |