ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
Help Needed : JComboBox and Table (Tk)
by Suresh Bhatt other posts by this author
Feb 25 2004 9:37AM messages near this date
Re: (no subject) (cgi problem on IIS) | Re: Module Term::ReadKey
--0-1712384150-1077701873=:78226
Content-Type: text/plain; charset=us-ascii

Hi all,I am new to perl Tk and i need help regarding combo box and tables.1)  I need to set 
the value of the combo box into a variable. for example in the following code ... #!/usr/bin
/perluse Tk;use Tk::JComboBox;my $mw = MainWindow-> new();my $jcb = $mw->JComboBox(          
         -relief =>  'groove',                   -popuprelief => 'groove',                   
-highlightthickness =>  0,                   -choices => [qw/Black Blue Green Purple Red Yell
ow/],                                         )-> pack;$jcb->setSelected( 'Yellow' );$index =
 $jcb-> getSelectedIndex();print $index;MainLoop;whenever i select an item from the choices e
g. Green, i need to assign ' Green ' to the variable $index. How do i go about the same ....
2)  Further how do we refresh the cells in a table on run time. I am able to populate it onc
e, but i need to refresh the cell when ever i get new data automatically.RegardsSuresh

---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
--0-1712384150-1077701873=:78226
Content-Type: text/html; charset=us-ascii

Hi all,

I am new to perl Tk and i need help regarding combo box and tables.

1)  I need to set the value of the combo box into a variable. for example in the following c
ode ... 

#!/usr/bin/perl
use Tk;
use Tk::JComboBox;
my $mw = MainWindow-> new();
my $jcb = $mw-> JComboBox(
                   -relief =>  'groove',
                   -popuprelief =>  'groove',
                   -highlightthickness =>  0,
                   -choices =>  [qw/Black Blue Green Purple Red Yellow/],
                                         )-> pack;
$jcb-> setSelected( 'Yellow' );
$index = $jcb-> getSelectedIndex();
print $index;

MainLoop;

whenever i select an item from the choices eg. Green, i need to assign ' Green ' to the vari
able $index. 

How do i go about the same ....

2)  Further how do we refresh the cells in a table on run time. I am able to populate it onc
e, but i need to refresh the cell when ever i get new data automatically.

Regards
Suresh<p> <hr SIZE=1>
Do you Yahoo!?<br> 
Yahoo! SiteBuilder - Free web site building tool. <a href="http://us.rd.yahoo.com/evt=21608/
*http://webhosting.yahoo.com/ps/sb/"> <b>Try it!</b></a>
--0-1712384150-1077701873=:78226--
Attachments:
unknown1


Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved