ArtProvider and IconBundle, plus general style questions

Hi all,
after looking at wxWidgets docs on wxArtProvider here
http://docs.wxwidgets.org/trunk/classwx_art_provider.html#0bb64950e85d0cc36977c01f864fdef8
I see that there exists a CreateIconBundle method that can be
overridden to provide custom icon bundles. Unfortunately I could not
find such thing in wxPython, only CreateBitmap and CreateIcon.
So the question is - is there a native way to get wx.IconBundle from
wx.ArtProvider in wxPython (on MSW at least)? The only alternative
coming to my mind would be to tweak the overridden CreateIcon method
to return either wx.Icon or wx.IconBundle depending on supplied artid.

And since I'm asking about ArtProvider, I would also like to ask a
more general style question. Since I'm creating the custom
ArtProvider, it involves creating custom ArtID's (as constants). These
ArtID's must be usable inside my package itself, but also from outside
of the package (to be able to use them when calling the custom
ArtProvider). Where should I better store the definitions of my custom
ArtID's from the convenience/style point of view? What I'm doing now
is putting them in a separate module called id, and then using "from
id import *" from inside the package and "from mypackage import id"
from outside of the package. Actually this question is interesting for
me not only for wx, but for Python in general (where to better store
package constants).

Thanks for help,
Pavlo.

Hi,
not sure, if it answers your first question, but you can simply use
something like:

            iconBndl = wx.IconBundle()
            iconBndl.AddIcon(wx.ArtProvider.GetIcon(wx.ART_HELP, size=(16,16)))
            iconBndl.AddIcon(wx.ArtProvider.GetIcon(wx.ART_HELP, size=(32,32)))
            frm.SetIcons(iconBndl)
(it seems to work ok on windows and linux)
hth,
  vbr

···

2009/7/4 Pavlo Shchelokovskyy <shchelokovskyy@gmail.com>:

Hi all,
after looking at wxWidgets docs on wxArtProvider here
http://docs.wxwidgets.org/trunk/classwx_art_provider.html#0bb64950e85d0cc36977c01f864fdef8
I see that there exists a CreateIconBundle method that can be
overridden to provide custom icon bundles. Unfortunately I could not
find such thing in wxPython, only CreateBitmap and CreateIcon.
So the question is - is there a native way to get wx.IconBundle from
wx.ArtProvider in wxPython (on MSW at least)? The only alternative
coming to my mind would be to tweak the overridden CreateIcon method
to return either wx.Icon or wx.IconBundle depending on supplied artid.

...
Thanks for help,
Pavlo.
--~--~---------~--~----~------------~-------~--~----~

Pavlo Shchelokovskyy wrote:

Hi all,
after looking at wxWidgets docs on wxArtProvider here
http://docs.wxwidgets.org/trunk/classwx_art_provider.html#0bb64950e85d0cc36977c01f864fdef8
I see that there exists a CreateIconBundle method that can be
overridden to provide custom icon bundles. Unfortunately I could not
find such thing in wxPython, only CreateBitmap and CreateIcon.

You are reading the docs for the 2.9 version (the 'trunk' in the URL above.) IconBundle support is a new feature added in 2.9.

···

--
Robin Dunn
Software Craftsman