Esteemed monks,

I seem to be having more trouble with Perl/Tk than a monkey with a whole case of bananas!

In this code I have a Toplevel with two BrowseEntry's on it. One is populated from a globally declared array, the other from a database search.

But when I select a value in the upper box, it appears in the lower one as well, likewise, If I select a value in the lower box it appers in the upper one.

Where on earth am I going wrong?

sub doListPull { my %ds; my $rec; my ($id, $datasource, $ds_desc); debug("+doListPullDialog"); if ( ! Exists($tlp)) { $tlp = $mainwindow->Toplevel(); $tlp->title("List Pulling Configuration"); my $tlp_pt = $tlp->BrowseEntry(-label => 'Pull list type', -variable => $state->{pullType})->grid(-padx => 5, -pa +dy => 5); $tlp_pt->focus; $tlp_pt->insert('end', @pullTypes); my $tlp_ds = $tlp->BrowseEntry(-label => "DataSource", -variable => $state->{pullDs})->grid(-padx => 5, -pady + => 5); my $SQL = "SELECT id, sourcename, sourcedesc from datasource;" +; my $sth = $dbh->prepare( $SQL ); $sth->execute; while (($id, $datasource, $ds_desc) = $sth->fetchrow_array) { $tlp_ds->insert('end', ($datasource." ".$ds_desc)); $rec->{$datasource} = ${ds_desc}; $dsources[$id] = $rec; } } debug("-doListPullDialog"); }
$state is a globally declared hash to store the current values of the various parts of the script.

Frustrated monk!

...john


In reply to Perl/Tk - values appearing in the wrong place! by jdtoronto

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.