$f->Button(-text => "FindSelectionNext", -command => [$t->{'rtext'} => "FindSelectionNext"]) #### ######################################################################## # get current selected text and search for the next occurrence sub FindSelectionNext { my ($w) = @_; my $selected; eval {$selected = $w->SelectionGet(-selection => "PRIMARY"); }; return if($@); return unless (defined($selected) and length($selected)); $w->FindNext('-forward', '-exact', '-case', $selected); }