API Reference

Adwaita icon theme for wxPython.

Classes:

AdwaitaIconTheme(name, comment, directories)

The Adwaita Icon Theme.

wxAdwaitaIconTheme()

wx.ArtProvider subclass providing the Adwaita Icon Theme.

Functions:

version()

Returns the version of this package and the icon theme, formatted for printing.

class AdwaitaIconTheme(name, comment, directories, inherits=None, scaled_directories=None, hidden=False, example='')[source]

Bases: HicolorIconTheme

The Adwaita Icon Theme.

Parameters
  • name (str) – short name of the icon theme, used in e.g. lists when selecting themes.

  • comment (str) – longer string describing the theme

  • inherits (Optional[Sequence[str]]) –

    The name of the theme that this theme inherits from. If an icon name is not found in the current theme, it is searched for in the inherited theme (and recursively in all the inherited themes). Default None.

    If no theme is specified implementations are required to add the “hicolor” theme to the inheritance tree. An implementation may optionally add other default themes in between the last specified theme and the hicolor theme.

  • directories (Sequence[Directory]) – list of subdirectories for this theme. For every subdirectory there must be a section in the index.theme file describing that directory.

  • scaled_directories (Optional[Sequence[Directory]]) – Additional list of subdirectories for this theme, in addition to the ones in Directories. These directories should only be read by implementations supporting scaled directories and was added to keep compatibility with old implementations that don’t support these. Default None.

  • hidden (bool) – Whether to hide the theme in a theme selection user interface. This is used for things such as fallback-themes that are not supposed to be visible to the user. Default False.

  • example (str) – The name of an icon that should be used as an example of how this theme looks. Default ''.

Attributes:

__class_getitem__

Methods:

__eq__(other)

Return self == other.

__iter__()

Iterate over the attributes of the class.

__repr__()

Return a string representation of the IconTheme.

__str__()

Return str(self).

create()

Create an instance of the Adwaita Icon Theme.

find_icon(icon_name, size, scale[, …])

Searches for the icon with the given name and size.

from_configparser(theme_index_path)

Constructs a IconTheme from config file.

__class_getitem__ = <bound method GenericAlias of <class 'wx_icons_adwaita.AdwaitaIconTheme'>>

Type:    MethodType

__eq__(other)

Return self == other.

Return type

bool

__iter__()

Iterate over the attributes of the class.

Return type

Iterator[Tuple[str, ~_V]]

__repr__()

Return a string representation of the IconTheme.

Return type

str

__str__()

Return str(self).

Return type

str

classmethod create()[source]

Create an instance of the Adwaita Icon Theme.

Return type

AdwaitaIconTheme

find_icon(icon_name, size, scale, prefer_this_theme=True)[source]

Searches for the icon with the given name and size.

Parameters
  • icon_name (str) – The name of the icon to find. Any FreeDesktop Icon Theme Specification name can be used.

  • size (int) – The desired size of the icon

  • scale (Any) – TODO: Currently does nothing

  • prefer_this_theme (bool) – Return an icon from this theme even if it has to be resized, rather than a correctly sized icon from the parent theme. Default True.

Return type

Optional[Icon]

Returns

The icon if it was found, or None.

classmethod from_configparser(theme_index_path)

Constructs a IconTheme from config file.

Parameters

theme_index_path (Union[str, Path, PathLike])

Return type

IconTheme

version()[source]

Returns the version of this package and the icon theme, formatted for printing.

Return type

str

class wxAdwaitaIconTheme[source]

Bases: wxHicolorIconTheme

wx.ArtProvider subclass providing the Adwaita Icon Theme.

Methods:

CreateBitmap(id, client, size)

Returns the requested resource.

icon2bitmap(icon, size)

Converts an Icon to a wx.Bitmap.

CreateBitmap(id, client, size)[source]

Returns the requested resource.

Parameters
  • id (Any) – Unique identifier of the bitmap.

  • client (Any) – Identifier of the client (i.e. who is asking for the bitmap). This only serves as a hint.

  • size (Union[Tuple[int], Size]) – Preferred size of the bitmap. The function may return a bitmap of different dimensions; it will be automatically rescaled to meet client’s request.

Return type

Bitmap

static icon2bitmap(icon, size)

Converts an Icon to a wx.Bitmap.

Parameters
  • icon (Icon)

  • size (int) – The desired size of the icon. If the icon isn’t scalable the icon is returned in its original size.

Return type

Bitmap