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?
$state is a globally declared hash to store the current values of the various parts of the script.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"); }
Frustrated monk!
...john
In reply to Perl/Tk - values appearing in the wrong place! by jdtoronto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |