471,330 Members | 1,683 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

wxPython ListCtrl

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

Nov 5 '07 #1
1 3476
On Nov 5, 11:00 am, vedrandeko...@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

Nov 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Fabio Pliger | last post: by
reply views Thread by Robin Dunn | last post: by
reply views Thread by Robin Dunn | last post: by
6 posts views Thread by zdp | last post: by
5 posts views Thread by Benjamin | last post: by
1 post views Thread by Benjamin | last post: by
reply views Thread by asrekdal | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.