def __init__(self, parent, id=-1, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.TAB_TRAVERSAL, name = "scrolledpanel"): # RB: id parameter wasn't being passed wx.ScrolledWindow.__init__(self, parent, id, pos=pos, size=size, style=style, name=name) wx.EVT_CHILD_FOCUS(self, self.OnChildFocus)
def __init__(self, parent, *args, **kw): """ Creates a wx.Panel that correctly sets its background color to be the same as its parents. """ bg_color = kw.pop('bg_color', None) wx.Panel.__init__(self, parent, *args, **kw) wx.EVT_CHILD_FOCUS(self, self.OnChildFocus) if bg_color: self.SetBackgroundColour(bg_color) else: self.SetBackgroundColour(parent.GetBackgroundColour())
def __init__(self, parent, *args, **kw): """ Creates a wx.Panel that correctly sets its background color to be the same as its parents. """ bg_color = kw.pop('bg_color', None) wx.Panel.__init__(self, parent, *args, **kw) wx.EVT_CHILD_FOCUS(self, self.OnChildFocus) if bg_color: self.SetBackgroundColour(bg_color) else: # Mac/Win needs this, otherwise background color is black attr = self.GetDefaultAttributes() self.SetBackgroundColour(attr.colBg)
def __init__(self, parent): w, h = self.CalcSize(parent) wx.Window.__init__(self, id=-1, parent=parent, pos=wxPoint(0, 0), size=wx.Size(w, h), style=wx.CLIP_CHILDREN | wx.SUNKEN_BORDER) self.child = cEmptyChild(self) self.child.Move(2, 2) self.__normal_colour = self.GetBackgroundColour() self.selected = False wx.EVT_SET_FOCUS(self, self._on_set_focus) wx.EVT_CHILD_FOCUS(self, self._on_child_focus)