Callbacks

AvatarImageLoadFunc (size, *user_data)

ComboRowGetEnumValueNameFunc (value, *user_data)

ComboRowGetNameFunc (item, *user_data)

Details

Handy.AvatarImageLoadFunc(size, *user_data)
Parameters:
  • size (int) – the required size of the avatar

  • user_data (object or None) – user data

Returns:

the pixbuf to use as a custom avatar or NULL to fallback to the generated avatar

Return type:

GdkPixbuf.Pixbuf or None

Callback for loading an [class`Avatar`]’s image.

The returned [class`GdkPixbuf`.Pixbuf] is expected to be square with width and height set to size. The image is cropped to a circle without any scaling or transformation.

New in version 1.0.

Deprecated since version 1.2: use [method`Avatar`.set_loadable_icon] instead.

Handy.ComboRowGetEnumValueNameFunc(value, *user_data)
Parameters:
Returns:

a displayable name that represents value

Return type:

str

Callback for getting the name of a row from an enum.

Called for combo rows that are bound to an enumeration with [method`ComboRow`.set_for_enum] for each value from that enumeration.

See also: [func`enum_value_row_name`].

New in version 1.0.

Handy.ComboRowGetNameFunc(item, *user_data)
Parameters:
Returns:

a displayable name that represents item

Return type:

str

Callback for getting the name of a row.

Called for combo rows that are bound to a [iface`Gio`.ListModel] with [method`ComboRow`.bind_name_model] for each item that gets added to the model.

New in version 1.0.