I’m making a wx.TreeCtrl with folders in it and I want native-looking folder icons for it. (Need two icons, one for a closed folder and one for an open folder.)
In the TreeCtrl demo I saw that wxPython offers folder icons, but they don’t look native: They’re blue instead of yellow (for XP) and they have an arrow in them which XP’s folder icon don’t have. (I want the folders to look native on all platforms, not just XP.)
For windows you can use wx.IconLocation to reference the icons in c:\windows\system32\shell32.dll and then extract with wx.IconFromLocation. For Linux the icons you get from wx.ArtProvider should be the same ones used by the active Theme.
···
On 5/10/11 3:24 PM, cool-RR wrote:
Hey,
I'm making a `wx.TreeCtrl` with folders in it and I want native-looking
folder icons for it. (Need two icons, one for a closed folder and one
for an open folder.)
In the `TreeCtrl` demo I saw that wxPython offers folder icons, but they
don't look native: They're blue instead of yellow (for XP) and they have
an arrow in them which XP's folder icon don't have. (I want the folders
to look native on all platforms, not just XP.)
Trying to load the file c:\windows\system32\shell32.dll by path sounds like a bad idea. What if the user has Windows installed on a different drive or in a non-standard path? Is there a better solution?
Also, any clue what I do for Mac?
If it’s feasible I could make a little abstraction that would get the correct folder icon in a cross-platform way.
Trying to load the file `c:\windows\system32\shell32.dll` by path sounds
like a bad idea. What if the user has Windows installed on a different drive
or in a non-standard path? Is there a better solution?
Also, any clue what I do for Mac?
I wrote a patch to wxWidgets some (wow 4 years ago already) years ago
to add more native icons to the ArtProvider which was unfortunatly
never merged or any comment on alternate implementation given. The
current ArtProvider on wxMac only has the native Error/Info/Warning
icons.
Trying to load the file `c:\windows\system32\shell32.dll` by path sounds
like a bad idea. What if the user has Windows installed on a different drive
or in a non-standard path? Is there a better solution?
Also, any clue what I do for Mac?
I wrote a patch to wxWidgets some (wow 4 years ago already) years ago
to add more native icons to the ArtProvider which was unfortunatly
never merged or any comment on alternate implementation given. The
current ArtProvider on wxMac only has the native Error/Info/Warning
icons.
Will need to do the footwork yourself but may be able to see how to
get the icons from the Carbon/Cocoa api from that patch.
BTW, speaking of unlanded features, if you're interested, I've recently set up a git repo that mirrors wxWidgets, wxPython, and Phoenix, and if you want, you could throw your changes on a branch. The URL is:
I've seen so many patches / features get put in limbo, or have so many additional YAGNI requirements and changes tacked on before it would be approved to land that even getting simple stuff in becomes a major project. So with git branches it's easy to have the code somewhere that at least those that want it can use it, and maybe if we get some good patches in there, Robin might even be tempted to build off the git repo to get all the extra goodies. Especially something like this patch, which is a clear no-brainer to add in.
Anyway, just let me know if you want write access to the repo.
Thanks,
Kevin
···
On May 14, 2011, at 1:44 PM, Cody Precord wrote:
On Sat, May 14, 2011 at 3:36 PM, cool-RR <ram.rachum@gmail.com> wrote: