API Reference

Suru icon theme for wxPython 🐍.

Classes:

SuruIconTheme(name, comment, directories[, …])

wxSuruIconTheme()

Functions:

version()

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

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

Bases: HumanityIconTheme

Attributes:

__class_getitem__

__slots__

Methods:

__copy__()

__deepcopy__([memodict])

__eq__(other)

Return self == other.

__getstate__()

rtype

Dict[str, ~_V]

__iter__()

Iterate over the attributes of the class.

__repr__()

Return a string representation of the IconTheme.

__setstate__(state)

__str__()

Return str(self).

create()

Create an instance of the Suru Icon Theme.

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

type icon_name

str

from_configparser(theme_index_path)

Constructs a IconTheme from config file.

__class_getitem__ = <bound method GenericAlias of <class 'wx_icons_suru.SuruIconTheme'>>

Type:    MethodType

__copy__()
__deepcopy__(memodict={})
__eq__(other)

Return self == other.

Return type

bool

__getstate__()
Return type

Dict[str, ~_V]

__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

__setstate__(state)
__slots__ = ()

Type:    tuple

__str__()

Return str(self).

Return type

str

classmethod create()[source]

Create an instance of the Suru Icon Theme.

Return type

SuruIconTheme

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

  • size (int)

  • scale (Any)

  • 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.

Returns

Return type

Optional[Icon]

classmethod from_configparser(theme_index_path)

Constructs a IconTheme from config file.

Parameters

theme_index_path (Union[str, Path, PathLike])

Return type

IconTheme

inherits

Type:    List[str]

scaled_directories

Type:    List[Directory]

version()[source]

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

Return type

str

class wxSuruIconTheme[source]

Bases: wxHumanityIconTheme

Methods:

CreateBitmap(id, client, size)

Returns the requested resource.

HasNativeProvider()

rtype

bool

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 HasNativeProvider()
Return type

bool

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