Copying selected text from one text area to another. : ScrolledText « Tkinker « Python Tutorial

Home
Python Tutorial
1.Introduction
2.Data Type
3.Statement
4.Operator
5.String
6.Tuple
7.List
8.Dictionary
9.Collections
10.Function
11.Class
12.File
13.Buildin Function
14.Buildin Module
15.Database
16.Regular Expressions
17.Thread
18.Tkinker
19.wxPython
20.XML
21.Network
22.CGI Web
23.Windows
Python Tutorial » Tkinker » ScrolledText 
18.29.1.Copying selected text from one text area to another.
Copying selected text from one text area to another.
from Tkinter import *
import Pmw

class CopyTextWindowFrame ):
   def __init__self ):
      Frame.__init__self )
      Pmw.initialise()
      self.packexpand = YES, fill = BOTH )
      self.master.title"Select then click move" )

      self.text1 = Pmw.ScrolledTextself, text_width = 25, text_height = 12, text_wrap = WORD,
         hscrollmode = "static", vscrollmode = "static" )
      self.text1.packside = LEFT, expand = YES, fill = BOTH, padx = 5, pady = )

      self.copyButton = Buttonself, text = ">>", command = self.copyText )
      self.copyButton.packside = LEFT, padx = 5, pady = )

      self.text2 = Pmw.ScrolledTextself, text_state = DISABLED,
         text_width = 25, text_height = 12, text_wrap = WORD,
         hscrollmode = "static", vscrollmode = "static" )
      self.text2.packside = LEFT, expand = YES, fill = BOTH, padx = 5, pady = )

   def copyTextself ):
      self.text2.settextself.text1.getSEL_FIRST, SEL_LAST ) )

CopyTextWindow().mainloop()
18.29.ScrolledText
18.29.1.Copying selected text from one text area to another.Copying selected text from one text area to another.
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.