[Tkinter] !finddialog problem - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: [Tkinter] !finddialog problem (/thread-30178.html) |
!finddialog problem - Maryan - Oct-10-2020 Cant find the error, little help is appreciated. class FindDialog(Toplevel): def __init__(self, parent, *args, **kwargs): Toplevel.__init__(self, parent, *args, **kwargs) self.parent = parent self.geometry("450x200+550+200") self.title("Find") self.resizable(False,False) txtFind=Label(self,text="Find: ") txtFind.place(x=20,y=20) txtReplace=Label(self,text="Replace :") txtReplace.place(x=20,y=60) self.findInput=Entry(self,width=30) self.replaceInput=Entry(self,width=30) self.findInput.place(x=100,y=20) self.replaceInput.place(x=100,y=60) self.btnFind=Button(self,text="Find",command=self.parent.findWords) self.btnReplace=Button(self,text="Replace",command=self.parent.replaceWords) self.btnFind.place(x=200,y=90) self.btnReplace.place(x=240,y=90) def find(self): self.find=FindDialog(self) class MainMenu(Menu): def __init__(self, parent, *args, **kwargs): Menu.__init__(self, parent, *args, **kwargs) self.parent = parent self.edit = Menu(self, tearoff = 0) self.edit.add_command(label = 'Find', accelerator = 'Ctrl+F', command = self.parent.find)
RE: !finddialog problem - Larz60+ - Oct-11-2020 please show all code needed to be able to run. That includes all import statements. Thank you RE: !finddialog problem - Maryan - Oct-11-2020 if __name__ == '__main__': root = Tk() root.title = 'Text' MainApplication(root).pack(side = TOP, fill = BOTH, expand = True) root.geometry('1250x850') root.iconbitmap('icons/icon.ico') root.mainloop() I found the error, it was 3rd line - root.title('Text') |