[wxPython] 이벤트02 (사이즈 이벤트 예제 : wx.EVT_SIZE)

#!/usr/bin/python
# -*- coding: cp949 -*-
# sizeevent.py

import wx


class SizeEvent(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title)
        # 사이즈 조정 이벤트 연결
        self.Bind(wx.EVT_SIZE, self.OnSize)
        self.Centre()

    # 사이즈 조정 이벤트 처리함수
    def OnSize(self, event):
        # 타이틀에 이벤트 발생시 사이즈를 구하여 표시해준다.
        self.SetTitle(str(event.GetSize()))


class MyApp(wx.App):
    def OnInit(self):
        se = SizeEvent(None, -1, 'sizeevent.py')
        se.Show(True)
        return True


app = MyApp(0)
app.MainLoop()

[실행 화면]














by 하린아빠 | 2008/02/26 18:42 | wxPython | 트랙백 | 덧글(0)
트랙백 주소 : http://pythondev.egloos.com/tb/104016
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]

:         :

:

비공개 덧글



< 이전페이지 다음페이지 >