PeonyMenuItem

PeonyMenuItem — Menu item descriptor object

Functions

Properties

gchar * icon Read / Write
gchar * label Read / Write
PeonyMenu * menu Read / Write
gchar * name Read / Write / Construct Only
gboolean priority Read / Write
gboolean sensitive Read / Write
gchar * tip Read / Write

Signals

void activate Run Last

Types and Values

struct PeonyMenuItem

Object Hierarchy

    GObject
    ╰── PeonyMenuItem

Includes

#include <libpeony-extension/peony-menu-item.h>

Description

PeonyMenuItem is an object that describes an item in a file manager menu. Extensions can provide PeonyMenuItem objects by registering a PeonyMenuProvider and returning them from peony_menu_provider_get_file_items(), or peony_menu_provider_get_background_items(), which will be called by the main application when creating menus.

Functions

peony_menu_item_get_type ()

GType
peony_menu_item_get_type (void);

peony_menu_item_new ()

PeonyMenuItem *
peony_menu_item_new (const char *name,
                     const char *label,
                     const char *tip,
                     const char *icon);

Creates a new menu item that can be added to the toolbar or to a contextual menu.

Parameters

name

the identifier for the menu item

 

label

the user-visible label of the menu item

 

tip

the tooltip of the menu item

 

icon

the name of the icon to display in the menu item

 

Returns

a newly create PeonyMenuItem


peony_menu_item_activate ()

void
peony_menu_item_activate (PeonyMenuItem *item);

emits the activate signal.

Parameters

item

pointer to a PeonyMenuItem

 

peony_menu_item_set_submenu ()

void
peony_menu_item_set_submenu (PeonyMenuItem *item,
                             PeonyMenu *menu);

Attachs a menu to the given PeonyMenuItem.

Parameters

item

pointer to a PeonyMenuItem

 

menu

pointer to a PeonyMenu to attach to the button

 

Types and Values

struct PeonyMenuItem

struct PeonyMenuItem;

Property Details

The “icon” property

  “icon”                     gchar *

Name of the icon to display in the menu item.

Flags: Read / Write

Default value: NULL


The “label” property

  “label”                    gchar *

Label to display to the user.

Flags: Read / Write

Default value: NULL


The “menu” property

  “menu”                     PeonyMenu *

The menu belonging to this item. May be null.

Flags: Read / Write


The “name” property

  “name”                     gchar *

Name of the item.

Flags: Read / Write / Construct Only

Default value: NULL


The “priority” property

  “priority”                 gboolean

Show priority text in toolbars.

Flags: Read / Write

Default value: TRUE


The “sensitive” property

  “sensitive”                gboolean

Whether the menu item is sensitive.

Flags: Read / Write

Default value: TRUE


The “tip” property

  “tip”                      gchar *

Tooltip for the menu item.

Flags: Read / Write

Default value: NULL

Signal Details

The “activate” signal

void
user_function (PeonyMenuItem *peonymenuitem,
               gpointer       user_data)

Flags: Run Last