I am using a wxpython to contain an ObjectListView. I tried to put it into a wx.panel, but failed. The following is the image
I am very puzzled that why the ObjectListView is only showed in a 16x16 square? My code to realize the ObjectListView:
and my code to use it:
`LeftList = wx.BoxSizer( wx.VERTICAL )
self.m_panel2 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
p1 = MyListCtrl(self.m_panel2, -1)
LeftList.Add( p1, 1, wx.EXPAND |wx.ALL, 5 )
bSizer12.Add( LeftList, 1, wx.EXPAND, 5 )`
and my code of MyListCtrl is:
`class MyListCtrl(wx.Panel):
def __init__(self, parent, id):
wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY)
self.olv = ObjectListView(self, id, style=wx.LC_REPORT|wx.NO_BORDER)
self.Layout()
self.olv.SetColumns(...) `
Then the result is the image I posted at the head
My problem is what should I use to contain the ObjectListView in wxpython and how to use it
As acattle has already pointed out, you can follow my tutorial on the subject. I don't see anything in your screenshots that shows you actually adding any data to the ObjectListView widget or setting its size. If you resize the frame slightly and the widget magically appears, then you need to add a call to Layout(), probably at the top sizer or frame level. Otherwise, we'll need some real code to figure this out.