Inheritance diagram for wx.ArtProvider:
wx.ArtProvider class is used to customize the look of wxPython application. When wxPython needs to display an icon or a bitmap (e.g. in the standard file dialog), it does not use a hard-coded resource but asks wx.ArtProvider for it instead. This way users can plug in their own wx.ArtProvider class and easily replace standard art with their own version. All that is needed is to derive a class from wx.ArtProvider, override its CreateBitmap method and register the provider with Push.
There’s another way of taking advantage of this class: you can use it in your code and use platform native icons as provided by GetBitmap or GetIcon
Every bitmap is known to wx.ArtProvider under an unique ID that is used by when requesting a resource from it. The ID is represented by wx.ArtID type and can have one of these predefined values:
Additionally, any string recognized by custom art providers registered using Push may be used.
wx.ArtProvider class is used to customize the look of wxPython application. When wxPython needs to display an icon or a bitmap (e.g. in the standard file dialog), it does not use a hard-coded resource but asks wx.ArtProvider for it instead. This way users can plug in their own wx.ArtProvider class and easily replace standard art with their own version. All that is needed is to derive a class from wx.ArtProvider, override its CreateBitmap method and register the provider with Push
class MyArtProvider(wx.ArtProvider):
def __init__(self):
wx.ArtProvider.__init__(self)
def CreateBitmap(self, artid, client, size):
# Create your bitmap here...
return bmp
Returns:
Delete the given provider.
Parameters:
Returns:
bool
Query registered providers for bitmap with given ID.
Parameters:
Returns:
Query the providers for icon with given id and return it. Return wx.NullIcon if no provider provides it.
Parameters:
Returns:
Get the size hint of an icon from a specific Art Client, queries the topmost provider if platform_dependent is False
Parameters:
Returns:
Register new art provider and add it to the bottom of providers stack (i.e. it will be queried as the last one).
Parameters:
See also
Add new provider to the bottom of providers stack.
Parameters:
Remove latest added provider and delete it.
Returns:
bool
Remove latest added provider and delete it.
Returns:
bool
Register new art provider and add it to the top of providers stack (i.e. it will be queried as the first provider).
Parameters:
See also
Add new provider to the top of providers stack.
Parameters:
Remove provider. The provider must have been added previously! The provider is not deleted.
Parameters:
Returns:
bool