As said before yes.
So - here's the difference. Whatwould I have to do to get this going with a 2
step create ?
It also handles wrong under linux. Headers show, but the last column is only
extended to the end when I click and drag the end of the last header (as if
resizing column). The moment I release the mousebutton it's extended to the
end.
Is something wrong with when I initialize the mixin ? I tried setting the last
column to auto or fixed. same result both times. This below is the fixed size
version. I should mention that I load this via a custom xml handler from a
xrc file
Here's my code.
class PreAWListCtrl(wx.ListCtrl, ListCtrlAutoWidthMixin):
def __init__(self):
p = wx.PreListCtrl()
self.this = p.this
def Create(self, parent, id, pos, size, style, validator, name):
wx.ListCtrl.Create(self, parent, id, pos, size, style, validator,
name)
self._setOORInfo(self)
ListCtrlAutoWidthMixin.__init__(self)
def Populate(self,header,data,itemdata=None):
self.ClearAll()
for x in range(len(header)):
info = wx.ListItem()
info.m_mask = wx.LIST_MASK_TEXT | wx.LIST_MASK_IMAGE |
wx.LIST_MASK_FORMAT
info.m_image = -1
info.m_format = 0
info.m_text = header
self.InsertColumnInfo(x, info)
for x in range(len(data)):
self.InsertStringItem(x,data[0])
for y in range(len(data)-1):
self.SetStringItem(x,y+1,data[y+1])
if itemdata:
self.SetItemData(x,itemdata)
for x in range(len(header)-1):
self.SetColumnWidth(x, wx.LIST_AUTOSIZE)
self.SetColumnWidth(len(header)-1,100)
It also doesn't work with one step creation like: (same Populate method as
above)
class AWListCtrl(wx.ListCtrl, ListCtrlAutoWidthMixin):
def __init__(self, parent, ID, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=0,
validator=wx.DefaultValidator, name=None):
wx.ListCtrl.__init__(self, parent, ID, pos,
size, style, validator, name)
ListCtrlAutoWidthMixin.__init__(self)
···
On Tuesday 10 June 2003 10:27 am, Robin Dunn wrote:
Uwe C. Schroeder wrote:
> Hi.
>
> is there a bug in the autowidth mixin for ListCtrl ?
> When I create a subclass with the autowith mixin loaded (the one that
> fits the last column header to the right boundary) the headers aren't
> displayed anymore (on win2k). On linux everything is fine.
The wxListCtrl sample in the demo uses that mixin, does it still work?
--
UC
--
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417