Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Entering data using a TKperl widget

Posted on 1999-07-07
Medium Priority
Last Modified: 2010-03-04
What is the best way to Input data into a perl script using a TKperl widget. (something analogical to: $some_parameter = <stdin>;)
Question by:ronpo
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 1213921
Huh, are you trying to retrieve the value from a TK widget?


Author Comment

ID: 1213922
Actually Yes, i'm trying to assign a value to a parameter using a TkPerl widget. By now I could only figure out how to enter and edit text in a text wigdet but I couldn't assign it to a parameter (there is no command property in the Text or Entry widgets).


Accepted Solution

Mikky earned 400 total points
ID: 1213923
Let's suppose that your parameter is stored in $parm.
Why don't you create an Entry widget as follows:

my $entry = $widget->Entry(-textvariable=>\$parm);

This way $parm is automagically updated whenever the text in the Entry widget is changed by the user.  If it is initially undefined and you want to act on it when the user is finished filling it in, then you may also want to define a button so the user can tell your program when the entry has been filled in.  Otherwise, simply checking periodically whether it has become defined may result in grabbing a partial input before all the input has been specified.


Author Comment

ID: 1213924
Thanks Mikky, it works.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question