473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do i clear the elements of a textbox in perl/tk.

hi,
i m building a GUI using perl/tk and i have a reset button which is supposed to clear the elements of a text box but does not seem to be doing so.
$txt2-> delete('1.0','end');
this code says cannot call method delete....
is there a problem with this statement????????
Apr 7 '11 #1
5 4265
miller
1,089 Expert 1GB
A Tk::Text object does have a delete method, but are you actually working on such an object? Can't say for sure without seeing your code.

- Miller
Apr 7 '11 #2
its actually a simple text box for entry of elements.........but the reset button is supposed to clear that box but is giving an error........any idea???????
Apr 8 '11 #3
miller
1,089 Expert 1GB
Once again, can't say anything without seeing your code and knowing exactly what the error is you're getting.

Good luck.
Apr 8 '11 #4
Expand|Select|Wrap|Line Numbers
  1. use Tk;
  2. use Tk::Text ;
  3. #............
  4. my $txt2 = $mw1 -> Text(-width=>40, -height=>10) -> pack();
  5. my $reset = $mw1 -> Button(-text=>"Reset", -command =>\&reset9) -> pack();
  6. #.................
  7. sub reset9 {
  8. $txt2-> delete('1.0','end');
  9. };
  10.  
is dat much enuf?the whole code is too long.....
Apr 10 '11 #5
RonB
589 Expert Mod 512MB
Expand|Select|Wrap|Line Numbers
  1. $txt2->selectAll;
  2. $txt2->deleteSelected;
Apr 11 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Buddy Ferrera | last post by:
What is easiest way to access the four form elements used to login to fido webmail on the page below? http://www.fido.ca/portal/home/homepage.jsp?lang=en I want to create or modify a script to...
6
by: trope | last post by:
Does anyone have the code to clear all of the elements in a select menu? I've been having trouble with this following code: for (var i=0; i< 100; i++) document.addskill.cat2.options = null; ...
5
by: Jason Huang | last post by:
Hi, In my C# Windows Form MyForm, it has many TextBoxes, e.g., txtName, txtID, txtAddress, ..., it also has many ComboBoxes, e.g., cboState, cboGender. How do I clear all those controls's Text...
1
by: Danial | last post by:
Hi, I am using asp.net 2 and i want to blank all textbox data of one form with (for each control) and i write following coding in button control, but it did not work. Dim ctl As Control ...
1
by: jamesonworld | last post by:
Hi, I am new in coldfusion. I would be glad if you guys can help. I want my page to load and inside the search button i want the word "SEARCH" to happen. But when the user clicked to search for items...
1
by: Alex | last post by:
Hi. I have... well.... not very many computer-literate users to my web- site. For the textbox which expects an email address, for instance, I had to enter a default text like "Email..."...
6
by: RP | last post by:
I want to clear all the Text Boxes on the Form. Is there any short method to avoid clearing them one by one.
11
by: dteribery | last post by:
Hello, I am trying to make a program that when someone uses a scanner to scan a barcode that the number will automaticly be entered into a .txt file. I tired to use the most of the events and...
1
by: Iain Wilson | last post by:
Hi All I have a number of textboxes and a textarea on a web form - Using C#. By default each component contains some text - a hint for the user entering the data. What I need to do is clear...
9
by: grocery_stocker | last post by:
How are references and aliases in perl different than references in aliases in C++?
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.