# -*- coding: utf-8 -*-
import wx
class PaintFrame (wx.Frame ):
def __init__( self , parent ):
wx.Frame.__init__ ( self, parent, - 1, "Panit Frame" , size = ( 800, 600 ))
self.panel = wx.Panel ( self)
self.statusbar = self.CreateStatusBar()
self.statusbar.SetFieldsCount (3 )
self.statusbar.SetStatusWidths ([- 3, - 2, - 1])
self.panel.Bind (wx.EVT_MOTION , self.OnPaintMotion )
def OnPaintMotion( self , event ):
self.statusbar.SetStatusText (u"鼠标位置:" + str( event.GetPositionTuple()) , 0)
event.Skip ()
if __name__ == '__main__':
app = wx.PySimpleApp ()
frame = PaintFrame (None )
frame.Show (True )
app.MainLoop ()
import wx
class PaintFrame (wx.Frame ):
def __init__( self , parent ):
wx.Frame.__init__ ( self, parent, - 1, "Panit Frame" , size = ( 800, 600 ))
self.panel = wx.Panel ( self)
self.statusbar = self.CreateStatusBar()
self.statusbar.SetFieldsCount (3 )
self.statusbar.SetStatusWidths ([- 3, - 2, - 1])
self.panel.Bind (wx.EVT_MOTION , self.OnPaintMotion )
def OnPaintMotion( self , event ):
self.statusbar.SetStatusText (u"鼠标位置:" + str( event.GetPositionTuple()) , 0)
event.Skip ()
if __name__ == '__main__':
app = wx.PySimpleApp ()
frame = PaintFrame (None )
frame.Show (True )
app.MainLoop ()