write a simple text editor in perl tk

write a simple text editor in perl tk

Post by jiehuang00 » Sun, 14 Nov 2004 05:54:34


i am new to perl tk and i am trying to write a program that does the
following:

First, this program creates a text editor window, where i can paste
some well formatted data like below, which is generated by another
application.
Number 1: 100
Number 2: 200

This text editor would have a "Calculation" menu. When clicked, it
will do some specified calculation such as dividing Number 2 by Number
1 and then output something as below:
Number 1: 100
Number 2: 200
****Calculation******
Number 2 divided by number 1: 2

This text editor also has a "Save" button, which can save the content
of this text file into somewhere of the machine where the program is
running.

Any sample code to implement such thing is greatly appreciated.

Thanks very much.

Jie Huang
 
 
 

write a simple text editor in perl tk

Post by Marc Dashe » Sun, 14 Nov 2004 08:52:20

In article < XXXX@XXXXX.COM >, XXXX@XXXXX.COM
says...

. . . snip . . .


Do you have any reference materials or will you be relying on
us for information to complete this program? You really should
get MASTERING PERL/TK by Steve Lidie and Nancy Walsh.

--
Go to http://www.yqcomputer.com/ to send me e-mail.

 
 
 

write a simple text editor in perl tk

Post by zentar » Mon, 15 Nov 2004 23:35:30

On 12 Nov 2004 12:54:34 -0800, XXXX@XXXXX.COM (Jie Huang)



Well, you create a mainwindow, then a Text widget, then 2 buttons.

Your calculations can be done 2 ways, you can either read the last 2
lines after pasting them in, testing them with a regex, then perform the
calculation. Or you can "select" the lines to be operated on with the
mouse, and use the selected text, do do the calculations.

Sounds like homework. I do homework for $20/hour. :-)


--
I'm not really a human, but I play one on earth.
http://www.yqcomputer.com/
 
 
 

write a simple text editor in perl tk

Post by jiehuang00 » Wed, 17 Nov 2004 00:25:02

Hi, if you email me at XXXX@XXXXX.COM and tell me how i can
pay you $20, I would be willing to do so :)

Jie