Please support our Python advertiser: Programming Forums
Views: 903 | Replies: 0
![]() |
•
•
Join Date: Jun 2006
Location: Croatia
Posts: 12
Reputation:
Rep Power: 3
Solved Threads: 0
I want to make find in my text editor like in mozilla firefox on the bottom of my gui
this is only for learning.
How to make when I open find toolbar that i dont have possibiliti to open the toolbar again when first is opened.
It seems that I cant get text from Entry, my target is empty
this is only for learning.
PYTHON Syntax (Toggle Plain Text)
class MyClass(Frame): def onFind(self, target=None): if target == None: target = tkSimpleDialog.askstring('Find!', 'Search for string!') if target: where = self.text.search(target, INSERT, END) if where: pastit = where + ('+%dc' % len(target)) self.text.tag_remove(SEL, '1.0', END) self.text.tag_add(SEL, where, pastit) self.text.mark_set(INSERT, pastit) self.text.see(INSERT) self.text.focus() def findToolbar(self): frm = Frame(self.master) frm.pack(side=BOTTOM, expand=YES, fill=X) Button(frm, text='Quit!').pack(side=LEFT) e = Entry(frm) e.pack(side=LEFT) e.focus_set() target = e.get() b = Button(frm, text='find', command=lambda: self.onFind(target)) b.pack(side=LEFT)
It seems that I cant get text from Entry, my target is empty
Last edited by Gigs_ : Mar 31st, 2007 at 8:43 am.
Gigs_ has spoken!
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode