|
GUI Example Code
import wx
class GUI_Example( wx.Frame ):
def __init__( self ):
"""Initialise GUI Example"""
wx.Frame.__init__(
self,
None,
-1,
"GUI Example",
size = ( 400, 250 )
)
panel = wx.Panel( self, 1 )
panel.Bind( wx.EVT_MOTION, self.OnMove )
wx.StaticText(
panel,
-1,
"Position:",
pos = ( 16, 16 )
)
self.position_control = wx.TextCtrl(
panel,
-1,
"",
pos = ( 80, 14 )
)
def OnMove( self, event ):
"""On Mouse Cursor Move in Window"""
pos = event.GetPosition()
self.position_control.SetValue(
"%s, %s" % ( pos.x, pos.y )
)
def main():
"""GUI Example Code"""
example_application = wx.PySimpleApp()
example_frame = GUI_Example()
example_frame.Show( True )
example_application.MainLoop()
if __name__ == "__main__":
main()
GUI Developer Services Poised Solutions
GUI Development Resources
GUI Development Resources
|