473,414 Members | 1,667 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,414 software developers and data experts.

text area problem

i want to highlight(select) text field in a text area in perl.is there any way to that

any help..........
Oct 22 '08 #1
10 3360
KevinADC
4,059 Expert 2GB
perl has no "text area". Can you explain your question better?
Oct 22 '08 #2
perl has no "text area". Can you explain your question better?

i mean text box.i have made a text box using perl tk.i want to select some text inside the text box.how i do that.

thanks brother
Oct 22 '08 #3
nithinpes
410 Expert 256MB
i mean text box.i have made a text box using perl tk.i want to select some text inside the text box.how i do that.

thanks brother
Using tag method, set a background color first. You can use this color to highlight text later. E.g
Expand|Select|Wrap|Line Numbers
  1. my  $tx= $fr->Scrolled( 'Text', '-scrollbars' => 'e', '-background' => 'white',       
  2.   )->pack( -fill => 'both', -expand => 1, -side => 'bottom' );
  3.  
  4. $tx->tag(qw/configure color1 -background yellow/); ##yellow for highlight
  5. $tx->insert('insert', "This is ");
  6. $tx->insert('insert',"highlighted text",'color1');
  7. $tx->insert('insert', "\n ");
  8.  
-Nithin
Oct 22 '08 #4
thanks very much.i'm sorry.i've illustrate the question wrongly.

when i click the relevant text inside the text box it should select.when i click the text it should come another window that describes the properties of that text.that is the my question.if you don't understand pls tell me.i will explain.

thanks .cheers
Oct 22 '08 #5
Arepi
62
I dont understand what you want exatly ,but I give u 2 tips, I hope that help u



u can select a text widget in TK(set the cursor in this widget):


Expand|Select|Wrap|Line Numbers
  1. use Tk;    
  2. $mw->maxsize(500,800);                                
  3. $mw->minsize(500,800);
  4. $text=$mw->Text( -width=>65,
  5.                  -height=>5,
  6.          );
  7. $text->place(-x => 20,-y => 700);    
  8. $text->focus;    #set cursor to the chosen text widget
When u want take a line from text widget do this:


Expand|Select|Wrap|Line Numbers
  1. use Tk;    
  2. $mw->maxsize(500,800);                                
  3. $mw->minsize(500,800);
  4. $text=$mw->Text( -width=>65,
  5.                  -height=>5,
  6.          );
  7. $text->place(-x => 20,-y => 700);    
  8. #then u write to text widget
  9. $r=$text->get('1.0','1.0 lineend');       #take the first line from text
Oct 22 '08 #6
Arepi
62
u can also many line take(u think that field?)

Expand|Select|Wrap|Line Numbers
  1. @r=$text->get(’1.0’,’1.0 lineend’,’2.0’,’2.0 lineend’);
  2. #this get first second... lines from your text widget
results:
$r[0]="first line"
$r[1]="second line"
ect.
Oct 22 '08 #7
thanks brother.i think u ve not understand my problem.

in my text box it is displayed some mac addresses as follows.

0x001cc48468c2
0x001635749100
0x00219bd81383
0x000bcd5f295c
0x000c29a59daa

when i double click on one of mac address then i want to pop up a new window.but i don t know is it possible in perl tk.
how i do that

thanks again............
Oct 23 '08 #8
Arepi
62
thanks brother.i think u ve not understand my problem.

in my text box it is displayed some mac addresses as follows.

0x001cc48468c2
0x001635749100
0x00219bd81383
0x000bcd5f295c
0x000c29a59daa

when i double click on one of mac address then i want to pop up a new window.but i don t know is it possible in perl tk.
how i do that

thanks again............

Why dont make a browseentry? In that can u chose a line and to assign a subrutin.
Oct 23 '08 #9
ye it's also helped me.but i want is when i click on one mac address then it should come a new window.how i do that.i'm new to the perl.

any help greatly appreciated.........
Oct 28 '08 #10
Arepi
62
ye it's also helped me.but i want is when i click on one mac address then it should come a new window.how i do that.i'm new to the perl.

any help greatly appreciated.........
Expand|Select|Wrap|Line Numbers
  1. use Tk;
  2. $mw = MainWindow->new(-title => " Using BrowseEntry");
  3. $be = $mw->BrowseEntry(-variable => \$string,
  4.                                       -browsecmd => \&rutin);
  5. $be->pack();
  6. MainLoop();
  7. sub rutin
  8. {
  9.         $mw2 = MainWindow->new(-title => " New MainWindow");
  10. }
Oct 28 '08 #11

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

Similar topics

7
by: Cues Plus | last post by:
Hello, I have a simple form text area for people to add comments in. The problem is that using the standard <TEXT AREA NAME="comments" ROWS=4 COLS=35></TEXT AREA> Allows people to put in...
12
by: who be dat? | last post by:
I'm trying to make a webpage do the following: I want a user to be able to click on a given image (there will be more than one image). Upon clicking a given image, characters specific to that...
2
by: Bhupesh Naik | last post by:
This is a query regarding my problem to make a spell and grammar check possible in text area of a web page. We have aspx pages which are used to construct letters. The browser based screens...
10
by: Jake Barnes | last post by:
This weekend I wanted to learn AJAX, so I set up a little toy page where I could experiment. The idea of this page is that you click in one of the boxes to get some controls, at which point you can...
1
by: divya | last post by:
I have a form which has a textarea,name - txtTo where he adds email addresses.Now when he clicks on sendemail I want to open a mailto link with addresses taken from textarea. Example I added...
0
by: RateTheBuilder | last post by:
Hi I found the below scripts which are used to dynamically resize the height of the text area input control. The site I found it on www.webdeveloper.com had it being called with the following...
2
by: veinnz | last post by:
hi all... i'm kinda newbie in php...so i would like to ask ur guidance on how to compare the distribution of whitespace between two text area? so let's say text area 1 i type : hi how are you...
6
by: David Stone | last post by:
I have a simple question about the alt content of area elements within an image map: is it redundant to include phrases such as "link to..." or "jump to..."? My initial thought is 'yes', since...
2
by: pradeeps | last post by:
i have array with values.i want to insert this array into text area one per line.up to now my code is............ my @res=; my $tx->insert('end', @res); text area display this result in same...
1
by: phpmagesh | last post by:
Hi All, I have problem in the html page I have flash banner at the top of the page and i have menu in the same flash. this flash will cover the content area. so to access content area i used...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.