All pastes #179720 Raw Edit

Anonymous

public text v1 · immutable
#179720 ·published 2006-09-22 13:16 UTC
rendered paste body
import wx

class HamadsClass(wx.Frame):
	
	def __init__(self, parent, id, title, size):
		wx.Frame.__init__(self, parent, id, title, size)
		self.panel = wx.Panel(self)
		self.btn = wx.Button(self.panel, -1, "I GOT SOME APPLES", pos = (100, 100))
		
		self.Bind(wx.EVT_BUTTON, self.Click, self.btn)
		self.btn.Bind(wx.EVT_ENTER_WINDOW, self.OnEnter)
		self.btn.Bind(wx.EVT_LEAVE_WINDOW, self.OnExit)
		
		self.Show()
		
	def OnEnter(self, event):
		self.btn.SetLabel("NO! Chocolate !")
		event.Skip()
		
	def OnExit(self, event):
		self.btn.SetLabel("I GOT SOME APPLES")
		event.Skip()
		
	def Click(self, event):
		self.panel.SetBackgroundColour("Blue")
		self.panel.Refresh()
		

app = wx.PySimpleApp()
frame = HamadsClass(None, -1, "Hi Hamad", (400, 400))
app.MainLoop()