I have a BrowseEntry widget that populates a Entry widget using the browsecmd.
$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


In reply to BrowseEntry browsecmd causes error by jruff

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.