Why is Pmw.Blt sending Destroy messages to my Toplevel?

Phlip phlip_cpp at yahoo.com
Thu Aug 15 11:02:16 EDT 2002


Newsgroupies:

This really distracts because I need to bind to <Destroy> and perform
exit procedures. But these fire whenever Blt draws a line!

import Tkinter, Pmw
tk = Tkinter
root = Pmw.initialise()
root.withdraw()

top = tk.Toplevel()

def closing(event):
	print 'closing!', event.type

top.bind('<Destroy>', closing)
g = Pmw.Blt.Graph(top)
g.pack(expand = 1, fill = 'both')
vx = (0,1,2,3,4,5,6,7,8,9,10)
vy = (5,4,3,2,1,0,1,2,3,4,5)
g.line_create("f(x)=abs(x-5)", xdata = vx, ydata = vy)
tk.mainloop()

Why does this print "closing! 17" a bunch of times as the graph
paints?

--
  Phlip



More information about the Python-list mailing list