wxFrame don't have Bind attribute ??
Frank Millman
frank at chagford.com
Mon Oct 30 06:28:13 EST 2006
Jia Lu wrote:
> Steve Holden のメッセージ:
> > Perhaps you could show us the code that's failing,
>
> the code is :
>
> <code>
> #!/usr/bin/python -tt
>
> __author__ = "Jia Lu <roka100 at gmail.com>"
> __verstion__ = "1.0.0"
>
> import wx
>
> class MyFrame(wx.Frame):
> def __init__(self):
> wx.Frame.__init__(self, None, -1, "MyFrame", size=(300,300))
> panel = wx.Panel(self, -1)
> panel.Bind(wx.EVT_MOTION, self.OnMove)
> wx.StaticText(panel, -1, "Pos:", pos=(100,105))
> self.posCtrl = wx.TextCtrl(panel, -1, "", pos=(130,100))
>
> def OnMove(self, event):
> pos = event.GetPosition()
> self.posCtrl.SetValue("%s, %s" % (pos.x, pos.y))
>
> if __name__ == "__main__":
> app = wx.PySimpleApp()
> frame = MyFrame()
> frame.Show(True)
> app.MainLoop()
This works perfectly for me, using wxPython 2.6.3.2, on both Linux and
Windows.
What platform are you using?
Frank Millman
More information about the Python-list
mailing list