Fix example of using UltimateListCtrl in docstring

This commit is contained in:
Jenyay
2018-09-26 10:19:58 +03:00
parent 1e32a05ae2
commit fb7df41ea5

View File

@@ -91,23 +91,23 @@ Usage example::
class MyFrame(wx.Frame):
def __init__(self):
def __init__(self, parent):
wx.Frame.__init__(self, parent, -1, "UltimateListCtrl Demo")
list = ULC.UltimateListCtrl(self, wx.ID_ANY, agwStyle=wx.LC_REPORT | wx.LC_VRULES | wx.LC_HRULES | wx.LC_SINGLE_SEL)
list = ULC.UltimateListCtrl(self, wx.ID_ANY, agwStyle=ULC.ULC_REPORT | ULC.ULC_VRULES | ULC.ULC_HRULES | ULC.ULC_SINGLE_SEL | ULC.ULC_HAS_VARIABLE_ROW_HEIGHT)
list.InsertColumn(0, "Column 1")
list.InsertColumn(1, "Column 2")
index = list.InsertStringItem(sys.maxint, "Item 1")
index = list.InsertStringItem(sys.maxsize, "Item 1")
list.SetStringItem(index, 1, "Sub-item 1")
index = list.InsertStringItem(sys.maxint, "Item 2")
index = list.InsertStringItem(sys.maxsize, "Item 2")
list.SetStringItem(index, 1, "Sub-item 2")
choice = wx.Choice(list, -1, choices=["one", "two"])
index = list.InsertStringItem(sys.maxint, "A widget")
index = list.InsertStringItem(sys.maxsize, "A widget")
list.SetItemWindow(index, 1, choice, expand=True)
@@ -116,16 +116,16 @@ Usage example::
self.SetSizer(sizer)
# our normal wxApp-derived class, as usual
# our normal wxApp-derived class, as usual
app = wx.App(0)
if __name__ == "__main__":
app = wx.App(0)
frame = MyFrame(None)
app.SetTopWindow(frame)
frame.Show()
app.MainLoop()
frame = MyFrame(None)
app.SetTopWindow(frame)
frame.Show()
app.MainLoop()
Window Styles