On 23/06/14 19:36, Michael Lange wrote:

         self.eventlist = tk.Listbox(self.history,
                                     width=45, font=('mono','10', ''))
         self.eventlist.bind('<ButtonRelease-1>', self.eventSelect)
         self.eventlist.bind('<Double-1>',self.doEdit)
...
         self.editEvent = tk.Button(self.eventbuttons, text="Edit",
                                    command=self.doEdit)


      def doEdit(self, ev=None):
         event = self.eventlist.get(self.eventlist.curselection()).split
() me = MapEntry(self, event)
         data.updateEvent((self.eventID,) + me.result)
         self.showEvents()


MapEntry is the editing dialog box.

I cannot see anything that looks critical here, how do you calculate the
Toplevel's coords in the MapEntry class?

I don't, I just leave Tk to do its thing. Its a subclass of Fred's standard Dialog class with the body and apply methods overridden to populate the form with the original data and return the values of the fields when closed. Nothing clever there at all. It doesn't even use StrVars!

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to