Kafka has asked for the wisdom of the Perl Monks concerning the following question:
Hello dear monks,
I am trying to use JBrowseEntry so I can have hidden tags for items in a listbox.
According to the specification of JBRowseEntry, if I insert a hashref then reading the text variable or using get should return the key corresponding to the value selected.
It doesn't seem to work this way.
Code snippet:
I am trying to use JBrowseEntry so I can have hidden tags for items in a listbox.
According to the specification of JBRowseEntry, if I insert a hashref then reading the text variable or using get should return the key corresponding to the value selected.
It doesn't seem to work this way.
Code snippet:
Thanks#!/usr/bin/perl -w use Tk; require Tk::JBrowseEntry; my %color_of = ( "apple" => "red", "orange" => "orange", "grape" => "purple", ); my $MW = MainWindow->new( -title => 'Jbrowse', -name => 'Demo', ); my $var = "red"; my $tmp_jbe = $MW->JBrowseEntry(-textvariable=>\$var, -width=>10, -state=>'normal', -btntakesfocus=>0, )->pack(); $tmp_jbe->insert('end',\%color_of); my $but = $MW->Button( -text => "Print Value", -width => 30, -height => 3, -command => sub { my $value = $tmp_jbe->get(); print "Var = $var, Get Result $value\n"; } )->pack(); MainLoop;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: jbrowseentry using hashref does not seem to work
by flexvault (Monsignor) on Mar 31, 2016 at 10:15 UTC | |
by Kafka (Acolyte) on Mar 31, 2016 at 12:50 UTC | |
by flexvault (Monsignor) on Mar 31, 2016 at 17:15 UTC | |
by Kafka (Acolyte) on Apr 03, 2016 at 09:43 UTC | |
Re: jbrowseentry using hashref does not seem to work
by flexvault (Monsignor) on Apr 04, 2016 at 17:31 UTC |
Back to
Seekers of Perl Wisdom