ThunarxMenuItem

ThunarxMenuItem — The base class for menu items added to the context menus

Functions

Properties

gchar * icon Read / Write
gchar * label Read / Write
ThunarxMenu * menu Read / Write
gchar * name Read / Write / Construct Only
gboolean priority Read / Write
gboolean sensitive Read / Write
gchar * tooltip Read / Write

Signals

void activate Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── ThunarxMenuItem

Includes

#include <thunarx/thunarx.h>

Description

The class for menu items that can be added to Thunar's context menus by extensions implementing the ThunarxMenuProvider, ThunarxPreferencesProvider or ThunarxRenamerProvider interfaces. The items returned by extensions from *_get_menu_items() methods are instances of this class or a derived class.

Functions

thunarx_menu_item_new ()

ThunarxMenuItem *
thunarx_menu_item_new (const gchar *name,
                       const gchar *label,
                       const gchar *tooltip,
                       const gchar *icon);

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

Parameters

name

identifier for the menu item

 

label

user-visible label of the menu item

 

tooltip

tooltip of the menu item

 

icon

textual representation of the icon to display in the menu item, as returned by g_icon_to_string(). A path or icon name are valid representations too.

 

Returns

a newly created ThunarxMenuItem


thunarx_menu_item_activate ()

void
thunarx_menu_item_activate (ThunarxMenuItem *item);

Emits the activate signal.

Parameters

item

pointer to a ThunarxMenuItem instance

 

thunarx_menu_item_get_sensitive ()

gboolean
thunarx_menu_item_get_sensitive (ThunarxMenuItem *item);

Returns whether the menu item is sensitive.

Parameters

item

pointer to a ThunarxMenuItem instance

 

thunarx_menu_item_set_sensitive ()

void
thunarx_menu_item_set_sensitive (ThunarxMenuItem *item,
                                 gboolean sensitive);

Sets the ::sensitive property of the menu item to sensitive .

Parameters

item

pointer to a ThunarxMenuItem instance

 

sensitive

TRUE to make the menu item sensitive

 

thunarx_menu_item_set_menu ()

void
thunarx_menu_item_set_menu (ThunarxMenuItem *item,
                            ThunarxMenu *menu);

Attaches menu to menu item.

Parameters

item

pointer to a ThunarxMenuItem instance

 

menu

pointer to a ThunarxMenu instance

 

thunarx_menu_item_list_free ()

void
thunarx_menu_item_list_free (GList *items);

Parameters

items

a list of ThunarxMenuItem.

[element-type ThunarxMenuItem]

Types and Values

struct ThunarxMenuItem

struct ThunarxMenuItem;

Property Details

The “icon” property

  “icon”                     gchar *

Textual representation of the icon (as returned by g_icon_to_string()) to display in the menu item.

Owner: ThunarxMenuItem

Flags: Read / Write

Default value: NULL


The “label” property

  “label”                    gchar *

Label to display to the user.

Owner: ThunarxMenuItem

Flags: Read / Write

Default value: NULL


The “menu” property

  “menu”                     ThunarxMenu *

The menu belonging to this item. May be null.

Owner: ThunarxMenuItem

Flags: Read / Write


The “name” property

  “name”                     gchar *

Name of the item.

Owner: ThunarxMenuItem

Flags: Read / Write / Construct Only

Default value: NULL


The “priority” property

  “priority”                 gboolean

Show priority text in toolbars.

Owner: ThunarxMenuItem

Flags: Read / Write

Default value: TRUE


The “sensitive” property

  “sensitive”                gboolean

Whether the menu item is sensitive.

Owner: ThunarxMenuItem

Flags: Read / Write

Default value: TRUE


The “tooltip” property

  “tooltip”                  gchar *

Tooltip for the menu item.

Owner: ThunarxMenuItem

Flags: Read / Write

Default value: NULL

Signal Details

The “activate” signal

void
user_function (ThunarxMenuItem *thunarxmenuitem,
               gpointer         user_data)

Flags: Run Last