[tkinter] help to implement search in a text editor

Post here if you need help with creating a Graphical User Interface in Python.

[tkinter] help to implement search in a text editor

Postby sarbasis007 » Wed Nov 06, 2013 11:25 am

i am working on making a text editor using tkinter and need help to implement search in it i have did this for search just how to relate it with my main frame class
Code: Select all
class Search(Frame):
   def __init__(self,parent):
      Frame.__init__(self,parent)
      self.search=EntryField(self,"Search:")
      self.search.pack(side=TOP,fill=X)
      Button(self,text="GO",command=self.do_it).pack()
   def do_it(self):
      stext=self.search.get_value()
      """svalue=StringVar()
      file=open(fname[-1],'r')
      svalue=file.read()
      li=" ".split(svalue)
      print li.index(stext)"""
      print "searching for %s"% (stext)

the doc part is cant be use
how to implement this in class later to it
Last edited by Yoriz on Wed Nov 06, 2013 12:49 pm, edited 2 times in total.
Reason: First post lock, Added code tags, CHanged title
sarbasis007
 
Posts: 2
Joined: Wed Nov 06, 2013 11:18 am

Re: [tkinter] help to implement search in a text editor

Postby Yoriz » Wed Nov 06, 2013 12:51 pm

Hi, Welcome to the forums.
Please read the 'new users read this' link in my signature
('ive added code tags to your code for you this time)
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 565
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: [tkinter] help to implement search in a text editor

Postby sarbasis007 » Wed Nov 06, 2013 1:48 pm

thanx for that
sarbasis007
 
Posts: 2
Joined: Wed Nov 06, 2013 11:18 am


Return to GUI

Who is online

Users browsing this forum: Google Feedfetcher and 1 guest