
lightspd
Novice
Feb 12, 2013, 12:59 PM
Post #1 of 3
(1274 views)
|
Tk and Tk::MListbox
|
Can't Post
|
|
I'm having an issue with MListbox. Randomly it will throw the following error. "Can't use string ("") as a subroutine ref while "strict refs" in use at MListbox.pm line 700" Everything works fine, till unknown happens and then constant errors till the program is restarted. The rest of the program works fine and continues to work fine. There is no change in the data being placed in the rows or columns. First code section is mine, second is from MListbox.pm. As suggested in a post on another site, I tried changing the SUPER's to Tk::Listbox, but that didn't help.
my $searchRes = $top->DialogBox(-title => 'Search Results', -buttons => ['OK', 'Cancel'],); my @dispRes = qw(ID FirstName LastName); my $ml = $searchRes->Scrolled( qw/MListbox -selectmode single -scrollbars oe -font small / )->pack(-expand => 1, -fill => 'both'); foreach my $colHdrs (@dispRes){ $ml->columnInsert('end',-text=>$colHdrs); } foreach (@dispRes){ push @row, $hash{$_}; <-- this is returned by another function, data dump shows no change. } $ml->insert('end', \@row); $ml->see('end'); <-- Error get's thrown here $ml->update; my $answer = $searchRes->Show(); MListbox.pm around line 700. $code becomes undef and possibly other values, but that's the one that's throwing the error above and being undef.
sub _selectionUpdate { my ($w, $code, $l, @args) = @_; ; if (@args) { foreach (@{$w->{'_columns'}}) { &$code($_->Subwidget("listbox"), @args); } } else { &$code($w->{'_columns'}->[0]->Subwidget("listbox")); } }
|