gkx947n has asked for the wisdom of the Perl Monks concerning the following question:
what i hoped would happen is that the choices in array @dataa would be used to fill the listbox contents and once the first caharcter was entered the contents would be altered to array @datab but i just get error "XS_Tk__Callback_Call error:Can't call method "configure" on an undefined value at line 22". any help will go along way to restoring my sanity Thank you for your time in reading this far -Danieluse Tk; use Tk::MatchEntry; @dataa = [ qw/Abberley Abberton Abbotsley Accrington/]; @datab = [ qw/Babraham Bacton Bexhill Bradfield/]; my $mw = MainWindow->new(-title => "i wish this would work",); $mw->geometry("200x70+0+0"); my $label = $mw->label("type somthing in the box"); my $me = $mw->MatchEntry( -variable => \$place, -choices => @dataa, -autosort => 0, -fixedwidth => 0, -ignorecase => 1, -maxheight => 10, -listwidth => 240, -entercmd => sub {#do some stuff }, -onecmd => sub {#do some stuff then $me->configure('choices' => @datab); }, )->pack(-side => 'left'); Tk::MainLoop();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: tk::matchentry changing the displayed choices
by GrandFather (Saint) on Jan 21, 2008 at 22:44 UTC | |
by gkx947n (Novice) on Jan 21, 2008 at 22:53 UTC | |
by GrandFather (Saint) on Jan 21, 2008 at 23:01 UTC | |
by gkx947n (Novice) on Jan 21, 2008 at 23:10 UTC | |
by GrandFather (Saint) on Jan 21, 2008 at 23:20 UTC | |
| |
|
Re: tk:matchentry changing the displayed choices
by toolic (Bishop) on Jan 21, 2008 at 22:15 UTC | |
by gkx947n (Novice) on Jan 21, 2008 at 22:26 UTC |