Top | ![]() |
![]() |
![]() |
![]() |
XfceAppMenuItemXfceAppMenuItem — a GtkMenuItem for app launchers. |
GObject ╰── GInitiallyUnowned ╰── GtkObject ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkItem ╰── GtkMenuItem ╰── GtkImageMenuItem ╰── XfceAppMenuItem
XfceAppMenuItem implements AtkImplementorIface, GtkBuildable and GtkActivatable.
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.
GtkWidget *
xfce_app_menu_item_new (void
);
Creates a new XfceAppMenuItem with an empty label.
Since 4.1
GtkWidget *
xfce_app_menu_item_new_with_label (const gchar *label
);
Creates a new XfceAppMenuItem containing a label.
Since 4.1
GtkWidget *
xfce_app_menu_item_new_with_mnemonic (const 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.
Since 4.1
GtkWidget * xfce_app_menu_item_new_with_command (const gchar *label
,const 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.
Since 4.1
GtkWidget * xfce_app_menu_item_new_full (const gchar *label
,const gchar *command
,const gchar *icon_filename
,gboolean needs_term
,gboolean snotify
);
Single-function interface to create an XfceAppMenuItem. Has the effect of
calling xfce_app_menu_item_new_with_label()
followed by all the
xfce_app_menu_item_set_*() functions.
Since 4.1
GtkWidget * xfce_app_menu_item_new_from_desktop_entry (gpointer *entry
,gboolean show_icon
);
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()
,
xfce_app_menu_item_set_icon_name()
, and
xfce_app_menu_item_set_startup_notification()
.
In Xfce 4.10 this function only returns NULL, since XfceDesktopEntry was removed from libxfce4util.
Since 4.1
void xfce_app_menu_item_set_name (XfceAppMenuItem *app_menu_item
,const gchar *name
);
Sets name
as the displayed name of the XfceAppMenuItem.
Since 4.1
void xfce_app_menu_item_set_icon_name (XfceAppMenuItem *app_menu_item
,const 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.
Since 4.1
void xfce_app_menu_item_set_command (XfceAppMenuItem *app_menu_item
,const gchar *command
);
Sets command
as the command run when the XfceAppMenuItem is clicked.
Since 4.1
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.
Since 4.1
app_menu_item |
An XfceAppMenuItem. |
|
needs_term |
TRUE if the application needs a terminal, FALSE if not. |
void xfce_app_menu_item_set_startup_notification (XfceAppMenuItem *app_menu_item
,gboolean snotify
);
Sets whether or not the application supports startup notification.
Since 4.1
app_menu_item |
An XfceAppMenuItem. |
|
snotify |
TRUE if the application supports startup notification, FALSE if not. |
#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
.
const gchar *
xfce_app_menu_item_get_name (XfceAppMenuItem *app_menu_item
);
Returns the current name/label set for the XfceAppMenuItem, or NULL.
Since 4.1
const gchar *
xfce_app_menu_item_get_icon_name (XfceAppMenuItem *app_menu_item
);
Returns the current icon name set for the XfceAppMenuItem, or NULL.
Since 4.1
const gchar *
xfce_app_menu_item_get_command (XfceAppMenuItem *app_menu_item
);
Returns the current command set for the XfceAppMenuItem, or NULL.
Since 4.1
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.
Since 4.1
gboolean
xfce_app_menu_item_get_startup_notification
(XfceAppMenuItem *app_menu_item
);
Checks whether or not the command executed by this XfceAppMenuItem supports startup notification.
Since 4.1
#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
.
void
xfce_app_menu_item_set_icon_size (guint icon_size
);
xfce_app_menu_item_set_icon_size
is deprecated and should not be used in newly-written code.
This function currently does nothing; the 'menu' icon size is always used.
Since 4.1
Sets the icon size that should be used when constructing XfceAppMenuItems
with icons. This is a static
method and does not need an instance of
XfceAppMenuItem to exist before it is called.
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.
Since 4.1
“command”
property“command” gchar *
The command to run when the item is clicked.
Flags: Read / Write
Default value: NULL
“icon-name”
property“icon-name” gchar *
The name of the themed icon to display next to the item.
Flags: Read / Write
Default value: NULL
“label”
property“label” gchar *
The label displayed in the item.
Flags: Read / Write
Default value: NULL
“needs-term”
property“needs-term” gboolean
Whether or not the command needs a terminal to execute.
Flags: Read / Write
Default value: FALSE
“snotify”
property“snotify” gboolean
Whether or not the app supports startup notification.
Flags: Read / Write
Default value: FALSE
“use-underline”
property“use-underline” gboolean
Whether or not to use an underscore in the label as a keyboard mnemonic.
Flags: Read / Write
Default value: FALSE