Functions

check_version (required_major, required_minor, required_micro)

panel_create_button ()

panel_create_toggle_button ()

panel_get_channel_name ()

panel_pixbuf_from_source (source, icon_theme, size)

panel_pixbuf_from_source_at_size (source, icon_theme, dest_width, dest_height)

panel_set_image_from_source (image, source, icon_theme, size, scale)

Details

Libxfce4panel.check_version(required_major, required_minor, required_micro)
Parameters:
  • required_major (int) – the required major version.

  • required_minor (int) – the required minor version.

  • required_micro (int) – the required micro version.

Returns:

None if the library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by the library and must not be freed or modified by the caller.

Return type:

str

Checks that the libxfce4panel library in use is compatible with the given version. Generally you would pass in the constants Libxfce4panel.MAJOR_VERSION, Libxfce4panel.MINOR_VERSION and Libxfce4panel.MICRO_VERSION as the three arguments to this function; that produces a check that the library in use is compatible with the version of libxfce4panel the extension was compiled against.

Checking the runtime version of the Libxfce4panel library
const gchar *mismatch;
mismatch = libxfce4panel_check_version (LIBXFCE4PANEL_MAJOR_VERSION,
                                     LIBXFCE4PANEL_MINOR_VERSION,
                                     LIBXFCE4PANEL_MICRO_VERSION);
if (G_UNLIKELY (mismatch != NULL))
  g_error ("Version mismatch: %<!---->s", mismatch);

New in version 4.8.

Libxfce4panel.panel_create_button()
Returns:

newly created Gtk.Button.

Return type:

Gtk.Widget

Create regular Gtk.Button with a few properties set to be useful in the Xfce panel: Flat (Gtk.ReliefStyle.NONE), no focus on click and minimal padding.

Libxfce4panel.panel_create_toggle_button()
Returns:

newly created Gtk.ToggleButton.

Return type:

Gtk.Widget

Create regular Gtk.ToggleButton with a few properties set to be useful in Xfce panel: Flat (Gtk.ReliefStyle.NONE), no focus on click and minimal padding.

Libxfce4panel.panel_get_channel_name()
Returns:

name of the Xfconf channel

See also: XFCE_PANEL_CHANNEL_NAME, xfce_panel_plugin_xfconf_channel_new and Libxfce4panel.PanelPlugin.get_property_base

Return type:

str

Function for the name of the Xfconf channel used by the panel. By default this returns “xfce4-panel”, but you can override this value with the environment variable XFCE_PANEL_CHANNEL_NAME.

New in version 4.8.

Libxfce4panel.panel_pixbuf_from_source(source, icon_theme, size)
Parameters:
  • source (str) – string that contains the location of an icon

  • icon_theme (Gtk.IconTheme or None) – icon theme or None to use the default icon theme

  • size (int) – size the icon that should be loaded

Returns:

a GdkPixbuf.Pixbuf or None if nothing was found. The value should be released with GObject.Object.unref when no longer used.

See also: Libxfce4panel.PanelImage

Return type:

GdkPixbuf.Pixbuf

See Libxfce4panel.panel_pixbuf_from_source_at_size

New in version 4.8.

Libxfce4panel.panel_pixbuf_from_source_at_size(source, icon_theme, dest_width, dest_height)
Parameters:
Returns:

a GdkPixbuf.Pixbuf or None if nothing was found. The value should be released with GObject.Object.unref when no longer used.

See also: Libxfce4panel.PanelImage

Return type:

GdkPixbuf.Pixbuf

Try to load a pixbuf from a source string. The source could be an abolute path, an icon name or a filename that points to a file in the pixmaps directory.

This function is particularly usefull for loading names from the Icon key of desktop files.

The pixbuf is never bigger than dest_width and dest_height. If it is when loaded from the disk, the pixbuf is scaled preserving the aspect ratio.

New in version 4.10.

Libxfce4panel.panel_set_image_from_source(image, source, icon_theme, size, scale)
Parameters:

See Libxfce4panel.panel_pixbuf_from_source_at_size()

See also: Libxfce4panel.PanelImage

New in version 4.17.4.