XfceAppMenuItem

XfceAppMenuItem — a GtkMenuItem for app launchers.

Synopsis


#include <libxfcegui4/libxfcegui4.h>


struct      XfceAppMenuItemPriv;
GtkWidget*  xfce_app_menu_item_new          ();
GtkWidget*  xfce_app_menu_item_new_with_label
                                            (gchar *label);
GtkWidget*  xfce_app_menu_item_new_with_mnemonic
                                            (gchar *label);
GtkWidget*  xfce_app_menu_item_new_with_command
                                            (gchar *label,
                                             gchar *command);
GtkWidget*  xfce_app_menu_item_new_from_desktop_entry
                                            (XfceDesktopEntry *entry);
void        xfce_app_menu_item_set_name     (XfceAppMenuItem *app_menu_item,
                                             gchar *name);
void        xfce_app_menu_item_set_icon_name
                                            (XfceAppMenuItem *app_menu_item,
                                             gchar *filename);
void        xfce_app_menu_item_set_command  (XfceAppMenuItem *app_menu_item,
                                             gchar *command);
void        xfce_app_menu_item_set_needs_term
                                            (XfceAppMenuItem *app_menu_item,
                                             gboolean needs_term);
#define     xfce_app_menu_item_set_image    (mi, img)
G_CONST_RETURN gchar* xfce_app_menu_item_get_name
                                            (XfceAppMenuItem *app_menu_item);
G_CONST_RETURN gchar* xfce_app_menu_item_get_icon_name
                                            (XfceAppMenuItem *app_menu_item);
G_CONST_RETURN gchar* xfce_app_menu_item_get_command
                                            (XfceAppMenuItem *app_menu_item);
gboolean    xfce_app_menu_item_get_needs_term
                                            (XfceAppMenuItem *app_menu_item);
#define     xfce_app_menu_item_get_image    (mi)
void        xfce_app_menu_item_set_icon_theme_name
                                            (const gchar *theme_name);

Description

XfceAppMenuItem is a direct subclass of GtkImageMenuItem, and is intended for use in application menus. XfceAppMenuItem essentially wraps an application: it knows how to run the application, what it is called, and what icon is used to represent it. An XfceAppMenuItem can also be generated directly from an XfceDesktopEntry.

Details

struct XfceAppMenuItemPriv

struct XfceAppMenuItemPriv;


xfce_app_menu_item_new ()

GtkWidget*  xfce_app_menu_item_new          ();

Creates a new XfceAppMenuItem with an empty label.

Returns : A new XfceAppMenuItem.

xfce_app_menu_item_new_with_label ()

GtkWidget*  xfce_app_menu_item_new_with_label
                                            (gchar *label);

Creates a new XfceAppMenuItem containing a label.

label : The text of the menu item.
Returns : A new XfceAppMenuItem.

xfce_app_menu_item_new_with_mnemonic ()

GtkWidget*  xfce_app_menu_item_new_with_mnemonic
                                            (gchar *label);

Creates a new XfceAppMenuItem containing a label. The label will be created using gtk_label_new_with_mnemonic(), so underscores in label indicate the mnemonic for the menu item.

label : The text of the menu item, with an underscore in front of the mnemonic character.
Returns : A new XfceAppMenuItem.

xfce_app_menu_item_new_with_command ()

GtkWidget*  xfce_app_menu_item_new_with_command
                                            (gchar *label,
                                             gchar *command);

Creates a new XfceAppMenuItem containing a label. The item's activate signal will be connected such that command will run when it is clicked.

label : The text of the menu item, with an underscore in front of the mnemonic character.
command : The command associated with the menu item.
Returns : A new XfceAppMenuItem.

xfce_app_menu_item_new_from_desktop_entry ()

GtkWidget*  xfce_app_menu_item_new_from_desktop_entry
                                            (XfceDesktopEntry *entry);

Creates a new XfceAppMenuItem using parameters from the application specified in a XfceDesktopEntry object. This has the effect of calling xfce_app_menu_item_new_with_command(), xfce_app_menu_item_set_needs_term(), and xfce_app_menu_item_set_icon_name().

entry : An XfceDesktopEntry describing the menu item to create.
Returns : A new XfceAppMenuItem.

xfce_app_menu_item_set_name ()

void        xfce_app_menu_item_set_name     (XfceAppMenuItem *app_menu_item,
                                             gchar *name);

Sets name as the displayed name of the XfceAppMenuItem.

app_menu_item : An XfceAppMenuItem.
name : The name of the menu item the menu item.

xfce_app_menu_item_set_icon_name ()

void        xfce_app_menu_item_set_icon_name
                                            (XfceAppMenuItem *app_menu_item,
                                             gchar *filename);

Sets the icon of the XfceAppMenuItem using the specified filename. If the filename doesn't have a full pathname, standard icon search paths will be used. If the filename doesn't have an extension, the best image format found (if any) will be used. If there is already an icon set, the current one is freed, regardless if the icon is found or not.

app_menu_item : an XfceAppMenuItem.
filename : The filename of the icon.

xfce_app_menu_item_set_command ()

void        xfce_app_menu_item_set_command  (XfceAppMenuItem *app_menu_item,
                                             gchar *command);

Sets command as the command run when the XfceAppMenuItem is clicked.

app_menu_item : An XfceAppMenuItem.
command : The command to associate with the menu item.

xfce_app_menu_item_set_needs_term ()

void        xfce_app_menu_item_set_needs_term
                                            (XfceAppMenuItem *app_menu_item,
                                             gboolean needs_term);

Sets whether or not the command executed by this XfceAppMenuItem requires a terminal window to run.

app_menu_item : An XfceAppMenuItem.
needs_term : TRUE if the application needs a terminal, FALSE if not.

xfce_app_menu_item_set_image()

#define xfce_app_menu_item_set_image(mi, img) gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(mi), img)

Sets img as the GtkImage widget that displays the icon for XfceAppMenuItem mi.

mi :An XfceAppMenuItem.
img :A GtkImage.

xfce_app_menu_item_get_name ()

G_CONST_RETURN gchar* xfce_app_menu_item_get_name
                                            (XfceAppMenuItem *app_menu_item);

Returns the current name/label set for the XfceAppMenuItem, or NULL.

app_menu_item : An XfceAppMenuItem.
Returns : A name/label string.

xfce_app_menu_item_get_icon_name ()

G_CONST_RETURN gchar* xfce_app_menu_item_get_icon_name
                                            (XfceAppMenuItem *app_menu_item);

Returns the current icon name set for the XfceAppMenuItem, or NULL.

app_menu_item : An XfceAppMenuItem.
Returns : An icon name string.

xfce_app_menu_item_get_command ()

G_CONST_RETURN gchar* xfce_app_menu_item_get_command
                                            (XfceAppMenuItem *app_menu_item);

Returns the current command set for the XfceAppMenuItem, or NULL.

app_menu_item : An XfceAppMenuItem.
Returns : A command string.

xfce_app_menu_item_get_needs_term ()

gboolean    xfce_app_menu_item_get_needs_term
                                            (XfceAppMenuItem *app_menu_item);

Checks whether or not the command executed by this XfceAppMenuItem requires a terminal window to run.

app_menu_item : An XfceAppMenuItem.
Returns : TRUE if the item will spawn a terminal, FALSE if not.

xfce_app_menu_item_get_image()

#define xfce_app_menu_item_get_image(mi) gtk_image_menu_item_get_image(GTK_IMAGE_MENU_ITEM(mi))

Gets the GtkImage widget associated with XfceAppMenuItem mi.

mi :An XfceAppMenuItem.
Returns :A GtkImage.

xfce_app_menu_item_set_icon_theme_name ()

void        xfce_app_menu_item_set_icon_theme_name
                                            (const gchar *theme_name);

Sets the icon theme name that should be used when looking for icons for XfceAppMenuItems. This is a static method and does not need an instance of XfceAppMenuItem to exist before it is called.

theme_name : A theme name.