GarconMenuItem: garcon Reference Manual

## GarconMenuItem GarconMenuItem |

## Functions

GarconMenuItem * | garcon_menu_item_new ()
GarconMenuItem * | garcon_menu_item_new_for_path ()
GarconMenuItem * | garcon_menu_item_new_for_uri ()
gboolean | garcon_menu_item_reload ()
gboolean | garcon_menu_item_reload_from_file ()
GFile * | garcon_menu_item_get_file ()
gchar * | garcon_menu_item_get_uri ()
const gchar * | garcon_menu_item_get_desktop_id ()
void | garcon_menu_item_set_desktop_id ()
const gchar * | garcon_menu_item_get_command ()
void | garcon_menu_item_set_command ()
const gchar * | garcon_menu_item_get_try_exec ()
void | garcon_menu_item_set_try_exec ()
const gchar * | garcon_menu_item_get_name ()
void | garcon_menu_item_set_name ()
const gchar * | garcon_menu_item_get_generic_name ()
void | garcon_menu_item_set_generic_name ()
const gchar * | garcon_menu_item_get_comment ()
void | garcon_menu_item_set_comment ()
const gchar * | garcon_menu_item_get_icon_name ()
void | garcon_menu_item_set_icon_name ()
const gchar * | garcon_menu_item_get_path ()
void | garcon_menu_item_set_path ()
gboolean | garcon_menu_item_get_hidden ()
void | garcon_menu_item_set_hidden ()
gboolean | garcon_menu_item_requires_terminal ()
void | garcon_menu_item_set_requires_terminal ()
gboolean | garcon_menu_item_get_no_display ()
void | garcon_menu_item_set_no_display ()
gboolean | garcon_menu_item_supports_startup_notification ()
void | garcon_menu_item_set_supports_startup_notification ()
GList * | garcon_menu_item_get_categories ()
void | garcon_menu_item_set_categories ()
gboolean | garcon_menu_item_has_category ()
GList * | garcon_menu_item_get_actions ()
GarconMenuItemAction * | garcon_menu_item_get_action ()
void | garcon_menu_item_set_action ()
gboolean | garcon_menu_item_has_action ()
gboolean | garcon_menu_item_get_show_in_environment ()
gboolean | garcon_menu_item_only_show_in_environment ()
void | garcon_menu_item_ref ()
void | garcon_menu_item_unref ()
gint | garcon_menu_item_get_allocated ()
void | garcon_menu_item_increment_allocated ()
void | garcon_menu_item_decrement_allocated ()

## Properties

gchar * | command | Read / Write
gchar * | comment | Read / Write
gchar * | desktop-id | Read / Write
GFile * | file | Read / Write / Construct Only
gchar * | generic-name | Read / Write
gboolean | hidden | Read / Write
gchar * | icon-name | Read / Write
gchar * | name | Read / Write
gboolean | no-display | Read / Write
gchar * | path | Read / Write
gboolean | requires-terminal | Read / Write
gboolean | supports-startup-notification | Read / Write
gchar * | try-exec | Read / Write

## Signals

void | changed | Run First

## Object Hierarchy

        GObject
        ╰── GarconMenuItem

## Description

## Functions

### garcon_menu_item_new ()

    GarconMenuItem *
    garcon_menu_item_new (GFile *file);

### garcon_menu_item_new_for_path ()

    GarconMenuItem *
    garcon_menu_item_new_for_path (const gchar *filename);

### garcon_menu_item_new_for_uri ()

    GarconMenuItem *
    garcon_menu_item_new_for_uri (const gchar *uri);

### garcon_menu_item_reload ()

    gboolean
    garcon_menu_item_reload (GarconMenuItem *item,
                             gboolean *affects_the_outside,
                             GError **error);

### garcon_menu_item_reload_from_file ()

    gboolean
    garcon_menu_item_reload_from_file (GarconMenuItem *item,
                                       GFile *file,
                                       gboolean *affects_the_outside,
                                       GError **error);

### garcon_menu_item_get_file ()

    GFile *
    garcon_menu_item_get_file (GarconMenuItem *item);

Get the file for `item` .

#### Returns

a GFile. The returned object should be unreffed with `g_object_unref()` when no longer needed.

### garcon_menu_item_get_uri ()

    gchar *
    garcon_menu_item_get_uri (GarconMenuItem *item);

### garcon_menu_item_get_desktop_id ()

    const gchar *
    garcon_menu_item_get_desktop_id (GarconMenuItem *item);

### garcon_menu_item_set_desktop_id ()

    void
    garcon_menu_item_set_desktop_id (GarconMenuItem *item,
                                     const gchar *desktop_id);

### garcon_menu_item_get_command ()

    const gchar *
    garcon_menu_item_get_command (GarconMenuItem *item);

### garcon_menu_item_set_command ()

    void
    garcon_menu_item_set_command (GarconMenuItem *item,
                                  const gchar *command);

### garcon_menu_item_get_try_exec ()

    const gchar *
    garcon_menu_item_get_try_exec (GarconMenuItem *item);

### garcon_menu_item_set_try_exec ()

    void
    garcon_menu_item_set_try_exec (GarconMenuItem *item,
                                   const gchar *try_exec);

### garcon_menu_item_get_name ()

    const gchar *
    garcon_menu_item_get_name (GarconMenuItem *item);

### garcon_menu_item_set_name ()

    void
    garcon_menu_item_set_name (GarconMenuItem *item,
                               const gchar *name);

### garcon_menu_item_get_generic_name ()

    const gchar *
    garcon_menu_item_get_generic_name (GarconMenuItem *item);

### garcon_menu_item_set_generic_name ()

    void
    garcon_menu_item_set_generic_name (GarconMenuItem *item,
                                       const gchar *generic_name);

### garcon_menu_item_get_comment ()

    const gchar *
    garcon_menu_item_get_comment (GarconMenuItem *item);

### garcon_menu_item_set_comment ()

    void
    garcon_menu_item_set_comment (GarconMenuItem *item,
                                  const gchar *comment);

### garcon_menu_item_get_icon_name ()

    const gchar *
    garcon_menu_item_get_icon_name (GarconMenuItem *item);

### garcon_menu_item_set_icon_name ()

    void
    garcon_menu_item_set_icon_name (GarconMenuItem *item,
                                    const gchar *icon_name);

### garcon_menu_item_get_path ()

    const gchar *
    garcon_menu_item_get_path (GarconMenuItem *item);

### garcon_menu_item_set_path ()

    void
    garcon_menu_item_set_path (GarconMenuItem *item,
                               const gchar *path);

### garcon_menu_item_get_hidden ()

    gboolean
    garcon_menu_item_get_hidden (GarconMenuItem *item);

### garcon_menu_item_set_hidden ()

    void
    garcon_menu_item_set_hidden (GarconMenuItem *item,
                                 gboolean hidden);

### garcon_menu_item_requires_terminal ()

    gboolean
    garcon_menu_item_requires_terminal (GarconMenuItem *item);

### garcon_menu_item_set_requires_terminal ()

    void
    garcon_menu_item_set_requires_terminal
                                   (GarconMenuItem *item,
                                    gboolean requires_terminal);

### garcon_menu_item_get_no_display ()

    gboolean
    garcon_menu_item_get_no_display (GarconMenuItem *item);

### garcon_menu_item_set_no_display ()

    void
    garcon_menu_item_set_no_display (GarconMenuItem *item,
                                     gboolean no_display);

### garcon_menu_item_supports_startup_notification ()

    gboolean
    garcon_menu_item_supports_startup_notification
                                   (GarconMenuItem *item);

### garcon_menu_item_set_supports_startup_notification ()

    void
    garcon_menu_item_set_supports_startup_notification
                                   (GarconMenuItem *item,
                                    gboolean supports_startup_notification);

### garcon_menu_item_get_categories ()

    GList *
    garcon_menu_item_get_categories (GarconMenuItem *item);

### garcon_menu_item_set_categories ()

    void
    garcon_menu_item_set_categories (GarconMenuItem *item,
                                     GList *categories);

### garcon_menu_item_has_category ()

    gboolean
    garcon_menu_item_has_category (GarconMenuItem *item,
                                   const gchar *category);

### garcon_menu_item_get_actions ()

    GList *
    garcon_menu_item_get_actions (GarconMenuItem *item);

### garcon_menu_item_get_action ()

    GarconMenuItemAction *
    garcon_menu_item_get_action (GarconMenuItem *item,
                                 const gchar *action_name);

### garcon_menu_item_set_action ()

    void
    garcon_menu_item_set_action (GarconMenuItem *item,
                                 const gchar *action_name,
                                 GarconMenuItemAction *action);

### garcon_menu_item_has_action ()

    gboolean
    garcon_menu_item_has_action (GarconMenuItem *item,
                                 const gchar *action_name);

### garcon_menu_item_get_show_in_environment ()

    gboolean
    garcon_menu_item_get_show_in_environment
                                   (GarconMenuItem *item);

### garcon_menu_item_only_show_in_environment ()

    gboolean
    garcon_menu_item_only_show_in_environment
                                   (GarconMenuItem *item);

### garcon_menu_item_ref ()

    void
    garcon_menu_item_ref (GarconMenuItem *item);

### garcon_menu_item_unref ()

    void
    garcon_menu_item_unref (GarconMenuItem *item);

### garcon_menu_item_get_allocated ()

    gint
    garcon_menu_item_get_allocated (GarconMenuItem *item);

### garcon_menu_item_increment_allocated ()

    void
    garcon_menu_item_increment_allocated (GarconMenuItem *item);

### garcon_menu_item_decrement_allocated ()

    void
    garcon_menu_item_decrement_allocated (GarconMenuItem *item);

## Types and Values

## Property Details

### The `“command”` property

      “command”                  gchar *

Command to be executed when the menu item is clicked.

Flags: Read / Write

Default value: NULL

### The `“comment”` property

      “comment”                  gchar *

Comment/description for the application. To be displayed e.g. in tooltips of GtkMenuItems.

Flags: Read / Write

Default value: NULL

### The `“desktop-id”` property

      “desktop-id”               gchar *

The desktop-file id of this application.

Flags: Read / Write

Default value: NULL

### The `“file”` property

      “file”                     GFile *

file.

Flags: Read / Write / Construct Only

### The `“generic-name”` property

      “generic-name”             gchar *

GenericName of the application (will be displayed in menus etc.).

Flags: Read / Write

Default value: NULL

### The `“hidden”` property

      “hidden”                   gboolean

It means the user deleted (at his level) something that was present (at an upper level, e.g. in the system dirs). It's strictly equivalent to the .desktop file not existing at all, as far as that user is concerned.

Flags: Read / Write

Default value: FALSE

### The `“icon-name”` property

      “icon-name”                gchar *

Name of the icon to be displayed for this menu item.

Flags: Read / Write

Default value: NULL

### The `“name”` property

      “name”                     gchar *

Name of the application (will be displayed in menus etc.).

Flags: Read / Write

Default value: NULL

### The `“no-display”` property

      “no-display”               gboolean

Whether this menu item is hidden in menus.

Flags: Read / Write

Default value: FALSE

### The `“path”` property

      “path”                     gchar *

Working directory the application should be started in.

Flags: Read / Write

Default value: NULL

### The `“requires-terminal”` property

      “requires-terminal”        gboolean

Whether this application requires a terinal to be started in.

Flags: Read / Write

Default value: FALSE

### The `“supports-startup-notification”` property

      “supports-startup-notification” gboolean

Startup notification support.

Flags: Read / Write

Default value: FALSE

### The `“try-exec”` property

      “try-exec”                 gchar *

Path to an executable file on disk used to determine if the program is actually installed. If the path is not an absolute path, the file is looked up in the $PATH environment variable. If the file is not present or if it is not executable, the entry may be ignored (not be used in menus, for example).

Flags: Read / Write

Default value: NULL

## Signal Details

### The `“changed”` signal

    void
    user_function (GarconMenuItem *item,
                   gpointer        user_data)

Emitted when GarconMenuItem has been reloaded.

#### Parameters

item | a GarconMenuItem. |
user_data | user data set when the signal handler was connected. |

Flags: Run First