7bf854050f
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
73 lines
1.6 KiB
Python
73 lines
1.6 KiB
Python
#!/bin/env python
|
|
#----------------------------------------------------------------------------
|
|
# Name: test1.py
|
|
# Purpose: A minimal wxPython program
|
|
#
|
|
# Author: Robin Dunn
|
|
#
|
|
# Created:
|
|
# RCS-ID: $Id$
|
|
# Copyright: (c) 1998 by Total Control Software
|
|
# Licence: wxWindows license
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
|
from wxPython import *
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
class MyFrame(wxFrame):
|
|
def __init__(self, parent, id, title):
|
|
wxFrame.__init__(self, parent, id, title, wxPoint(100, 100), wxSize(160, 100))
|
|
self.Connect(-1, -1, wxEVT_MOVE, self.OnMove)
|
|
|
|
def OnCloseWindow(self, event):
|
|
self.Destroy()
|
|
|
|
def OnSize(self, event):
|
|
size = event.GetSize()
|
|
print "size:", size.width, size.height
|
|
|
|
def OnMove(self, event):
|
|
# Hmmm... Doesn't seem to be implmented in wxWin yet...
|
|
pos = event.GetPosition()
|
|
print "pos:", pos.x, pos.y
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
class MyApp(wxApp):
|
|
def OnInit(self):
|
|
frame = MyFrame(NULL, -1, "This is a test")
|
|
frame.Show(true)
|
|
self.SetTopWindow(frame)
|
|
return true
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
def main():
|
|
app = MyApp(0)
|
|
app.MainLoop()
|
|
|
|
|
|
def t():
|
|
import pdb
|
|
pdb.run('main()')
|
|
|
|
if __name__ == '__main__':
|
|
main()
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
|
#
|
|
# $Log$
|
|
# Revision 1.1 1998/08/09 08:28:05 RD
|
|
# Initial version
|
|
#
|
|
#
|