#!/bin/env /usr/bin/python from wxPython.wx import * from wxPython.grid import * from wxPython.lib.mixins.grid import wxGridAutoEditMixin import os class Bean(wxButton): def __init__(self,parent,id,label,pos,size): self.name = "Button ID: " + str(id) wxButton.__init__(self,parent,id,self.name,pos=pos,size=size) EVT_BUTTON(parent, id, self.button_click) self.onfire = NULL def button_click(self,evt): if (self.onfire != NULL): self.onfire() evt.Skip() return # required interface: def get_color(self): return self.GetBackgroundColour() def set_color(self, col): return self.SetBackgroundColour(col) def get_name(self): return self.name def support_firing(self): return 1 #yes def support_recieving_fire(self): return 0 #no def set_onfire(self, func): self.onfire = func def get_onfire(self): return NULL