On 9/1/12 9:56 PM, zhengqing wrote:
> Sorry!
> I mean I can't control the size of the checklistbox in combo control, no
> matter how I set the size.
>
> And in the function bellow:
>
> def Create(self, parent):
> self.checklistbox
>
>
> what is self and parent?
Like usual self is an instance of the class that the method is a member
of, in this case the ComboPopup. Parent is the widget that should be
used as the parent of the widget that is created.
> cc = wx.combo.ComboCtrl(self, size = (250, -1))
> tcp = CheckboxComboPopup()
> cc.SetPopupControl(tcp)
>
>
> It looks like checklistbox is not attribute of cc and tcp,
The Create method is not called until after the SetPopupControl method
above, so checklistbox does not exist until then. But after that point
in the code you should be able to use checklistbox (or call a method
that uses it) without problems.