[wxPython-users] SetImageList with TreeCtrl

Saketh Bhamidipati saketh.bhamidipati at gmail.com
Sun Jul 23 09:02:51 PDT 2006


On 7/23/06, Nizam Sayeed <ibnameen at gmail.com> wrote:
>
> Hello all,
>
> I have having trouble with calling the SetImageList method on a TreeCtrl
> object. Here is the code that I have:
>
>         sz =3D ( 16, 16 )
>         self.imagelist =3D wx.ImageList( sz[ 0 ], sz[ 1 ] )
>         self.folderidx =3D self.imagelist.Add( wx.ArtProvider.GetBitmap(
> wx.ART_FOLDER, wx.ART_OTHER, sz ) )
>         self.folderopenidx =3D self.imagelist.Add ( wx.ArtProvider.GetBit=
map(
> wx.ART_FILE_OPEN, wx.ART_OTHER, sz ) )
>
>          self.splitter =3D wx.SplitterWindow( self, -1 )
>         self.tree =3D wx.TreeCtrl( self.splitter, -1, wx.DefaultPosition,
> wx.DefaultSize,
>                                  wx.TR_HAS_BUTTONS|wx.TR_EDIT_LABELS )
>
>         self.tree.SetImagelist( self.imagelist )
>
>         self.list =3D wx.ListCtrl( self.splitter, -1, style =3D wx.LC_REP=
ORT )
>         self.CreateStatusBar()
>
> When the call to SetImageList is made, I get the following error:
>
> AttributeError: 'TreeCtrl' object has no attribute 'SetImagelist'
>
> I am using Python 2.4.3 (Windows) and wxPython 2.6.3.3 Unicode for Python
> 2.4. What am I doing wrong? Any help would be greatly appreciated.
>
> Best regards,
>
> Nizam Sayeed
>
You forgot to capitalize the l in SetImageList. Is this the problem?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200607=
23/0fb0d85d/attachment.htm


More information about the wxpython-users mailing list