2008年5月15日 星期四

wxPython裡面的API

紀錄一下目前學到的wxPython API

wx.Frame(parent, id=-1, title='', pos = wx.DefaultPosition,
size = wx.DefaultSize, style = wx.DEFAULT_FRAME_STYLE,
name = "frame")
: 初始化window的function

parent : wx.Window
id : int
title : string
pos : wx.Point
size : wx.Size
style
name : string

Move(wx.Point point)move a window to the given position
MoveXY(int x, int y)move a window to the given position
SetPosition(wx.Point point)set the position of a window
SetDimensions(wx.Point point, wx.Size size)
set the position and the size of a window

取得parent widget : parent.GetParent()

設定button按下event:

button1 = wx.Button(self, -1, '+', (10, 10))
self.Bind(wx.EVT_BUTTON, self.OnPlus, id=button1.GetId())
參考資料 :
The wxPython tutorial

沒有留言: