wxPython ListCtrl
kyosohma at gmail.com
kyosohma at gmail.com
Mon Nov 5 12:16:17 EST 2007
On Nov 5, 11:00 am, vedrandeko... at v-programs.com wrote:
> Hello,
>
> How can I Insert image with string in ListCtrl with this example:
>
> # Import ftputil module - like ftplib
> from ftputil import FTPHost
> # Create connection
> ftp=FTPHost("ftp.someserver.com","user","password")
>
> # LIST ALL FILES/FOLDERS ON SERVER
> for item in ftp._dir("/"):
> # Now check if item is file /folder
> if item is file insert this image: wx.ART_NORMAL_FILE and if
> the item is folder insert this image
> wx.ART_FOLDER
>
> .......how can I do the same on server with GenericDirCtrl?
>
> Regards,
> Vedran
I would recommend looking at the wxPython demo as it shows how to add
pictures to the listctrl there. You'll probably need to look at
wx.ArtProvider to get the correct syntax for using its images:
http://wxpython.org/docs/api/wx.ArtProvider-class.html
You might also find the wiki's entry on listctrls helpful:
http://wiki.wxpython.org/ListControls
Of course, it sounds like you're making your own FTP client, so I
would use one of the treectrl variants rather than a listctrl. See the
TreeListCtrl, the TreeMixin or the CustomTreeCtrl.
The demo also shows code for the GenericDirCtrl. See http://www.wxpython.org/download.php
You may also find the wxPython user's group more helpful for wxPython
specific inquiries: http://www.wxpython.org/maillist.php
Mike
More information about the Python-list
mailing list