The ArtProvider class
What does it do?
(from the wxWindows documentation)
wxArtProvider class is used to customize the look of wxWidgets application. When wxWidgets need to display an icon or a bitmap (e.g. in the standard file dialog), it does not use hard-coded resource but asks wxArtProvider for it instead. This way the users can plug in own wxArtProvider class and easily replace standard art with his/her own version.
The ArtProvider class offers an easy way to use standard icons in an application. Rather than having to load often-used bitmaps separately, it's possible to create an ArtProvider instance and ask it for a certain icon.
How to use it
First, create an instance:
art = ArtProvider((16,16))
The tuple (16,16) is optional and indicates a default size for the images. Other valid sizes are (32,32) and (48,48).
To get an image from the object, use GetBitmap(image, client, size):
bmp1 = art.GetBitmap('bookmark', 'toolbar', (32,32))
bmp2 = art.GetBitmap('up', 'menu') # use default size
The first line gets the icon "bookmark" from the "toolbar" collection with size (32,32).
The second line gets the icon "up" from the "menu" collection with the default size (in this case, (16,16)).
Note that the object returned is a wx.Bitmap. (There is currently no Wax equivalent for this yet.)
For a more elaborate example, see src/artprovider-1.py.