MyTetra Share
Делитесь знаниями!
wx.Frame.Bind(wx.EVENT, <signal>)
Время создания: 18.05.2017 21:33
Раздел: Python - wx - classes - wx - Frame - Events - Bind
Запись: xintrea/mytetra_db_mcold/master/base/14951324295dy0t5mfjr/text.html на raw.githubusercontent.com
# -*- coding: utf-8 -*-
# Chapter 1: wxPython starting points
# Recipe 4: Binding to events
#
import wx


class MyApp(wx.App):
def OnInit(self):
self.frame = wx.Frame(None, title="Binding Events")

# Bind to events we are interested in
self.frame.Bind(wx.EVT_SHOW, self.OnFrameShow)
self.frame.Bind(wx.EVT_CLOSE, self.OnFrameExit)

# Show the frame
self.frame.Show()
return True

def OnFrameShow(self, event):
theFrame = event.EventObject
print("Frame (%s) Shown!" % theFrame.Title)
event.Skip()

def OnFrameExit(self, event):
theFrame = event.EventObject
print("Frame (%s) is closing!" % theFrame.Title)
event.Skip()


if __name__ == "__main__":
app = MyApp(
False)
app.MainLoop()
Так же в этом разделе:
 
MyTetra Share v.0.65
Яндекс индекс цитирования