jruff has asked for the wisdom of the Perl Monks concerning the following question:
$addRefdesListbox = $addRefdesFrame2->BrowseEntry(-variable=>\$sear +chString, -fg=> 'black', -bg=> 'white', -exportselection => 0, -browsecmd => sub{$addRefdesEntry->insert('end',$refdesMaxValue{$searc +hString}+1)}, -listcmd=> \&doSearch, )->pack(-side=>'left');
If I change contents of the Entry widget {$addRefdesEntry}, I loose my reference to the BrowseEntry widget as shown when I try to do the following later in the program.
$refdesListbox->see($addRefdesListbox->Subwidget('slistbox')->curselec +tion());
The $addRefdesListbox->Subwidget('slistbox')->curselection() value is null if I edit the Entry widget. This yields the following error.
Tk::Error: wrong # args: should be ".toplevel.frame.frame.frame.frame. +frame1.frame.listbox see index" at C:/Perl/site/lib/Tk.pm line 228. Tk callback for .toplevel.frame.frame.frame.frame.frame1.frame.listbo +x [\&tepsTools::__ANON__] (menu invoke)
If I do not edit the Entry widget, program runs fine.
I would appreciate any insight into this. Thanks
20050317 Edit by ysth: code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: BrowseEntry browsecmd causes error
by zentara (Cardinal) on Mar 18, 2005 at 14:55 UTC | |
by jruff (Initiate) on Mar 18, 2005 at 22:57 UTC |