in reply to Autocompletion simulated in Tk

It's not entirely clear, to me anyways, what you are trying to do, but there is also JComboBox.
#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::JComboBox; #see also Tk::Spinbox my @choices; my $index; foreach my $f ( 'A' .. 'Z' ) { foreach my $s ( 'A' .. 'Z' ) { push @choices, "$f$s"; } } my $mw = MainWindow->new(); my $jcb = $mw->JComboBox( -relief => 'groove', # -popuprelief => 'groove', -mode => 'editable', -validate => 'match', -highlightthickness => 0, -choices => \@choices, -textvariable => \$index, -selectcommand => sub { print "Selected: $index\n"; } )->pack; MainLoop; #########################

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: Autocompletion simulated in Tk
by Ace128 (Hermit) on Jul 16, 2005 at 22:29 UTC
    Alright. Tk::MatchEntry it is! Thanks for the effort thought!