]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-13/list_icon.py
4 class DemoFrame(wx
.Frame
):
6 wx
.Frame
.__init
__(self
, None, -1,
7 "wx.ListCtrl in wx.LC_ICON mode",
10 # load some images into an image list
11 il
= wx
.ImageList(32,32, True)
12 for name
in glob
.glob("icon??.png"):
13 bmp
= wx
.Bitmap(name
, wx
.BITMAP_TYPE_PNG
)
16 # create the list control
17 self
.list = wx
.ListCtrl(self
, -1,
18 style
=wx
.LC_ICON | wx
.LC_AUTOARRANGE
)
20 # assign the image list to it
21 self
.list.AssignImageList(il
, wx
.IMAGE_LIST_NORMAL
)
23 # create some items for the list
26 self
.list.InsertImageStringItem(x
,
27 "This is item %02d" % x
, img
)
29 app
= wx
.PySimpleApp()