Top | ![]() |
![]() |
![]() |
![]() |
gboolean | allow-paths | Read / Write |
char * | default-icon | Read / Write |
XAppIconSize | icon-size | Read / Write |
GEnum ╰── XAppIconSize GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkWindow ╰── XAppGtkWindow ╰── XAppIconChooserDialog
The XAppIconChooserDialog creates a dialog so that the user can select an icon. It provides the ability to browse by category, search by icon name, or select from a specific file.
XAppIconChooserDialog *
xapp_icon_chooser_dialog_new (void
);
Creates a new XAppIconChooserDialog.
gint
xapp_icon_chooser_dialog_run (XAppIconChooserDialog *dialog
);
Shows the dialog and enters a separate main loop until an icon is chosen or the action is canceled.
xapp_icon_chooser_dialog_run (), xapp_icon_chooser_dialog_run_with_icon()
, and
xapp_icon_chooser_dialog_run_with_category()
may all be called multiple times. This is useful for
applications which use this dialog multiple times, as it may improve performance for subsequent
calls.
gint xapp_icon_chooser_dialog_run_with_icon (XAppIconChooserDialog *dialog
,gchar *icon
);
Like xapp_icon_chooser_dialog_run but selects the icon specified by icon
. This can be either an
icon name or a path. Passing an icon string or path that doesn't exist is accepted, but it may show
multiple results, or none at all. This behavior is useful if, for example, you wish to have the
user select an image file from a particular directory.
If the property allow_paths is FALSE, setting a path will yield no results when the dialog is opened.
xapp_icon_chooser_dialog_run (), xapp_icon_chooser_dialog_run_with_icon()
, and
xapp_icon_chooser_dialog_run_with_category()
may all be called multiple times. This is useful for
applications which use this dialog multiple times, as it may improve performance for subsequent
calls.
gint xapp_icon_chooser_dialog_run_with_category (XAppIconChooserDialog *dialog
,gchar *category
);
Like xapp_icon_chooser_dialog_run but selects a particular category specified by category
.
This is used when there is a particular category of icon that is more appropriate than the
others. If the category does not exist, the first category in the list will be selected. To
get a list of possible categories, use gtk_icon_theme_list_contexts()
.
xapp_icon_chooser_dialog_run (), xapp_icon_chooser_dialog_run_with_icon()
, and
xapp_icon_chooser_dialog_run_with_category()
may all be called multiple times. This is useful for
applications which use this dialog multiple times, as it may improve performance for subsequent
calls.
gchar *
xapp_icon_chooser_dialog_get_icon_string
(XAppIconChooserDialog *dialog
);
Gets the currently selected icon from the dialog. If allow-paths is TRUE, this function may return either an icon name or a path depending on what the user selects. Otherwise it will only return an icon name.
void xapp_icon_chooser_dialog_add_button (XAppIconChooserDialog *dialog
,GtkWidget *button
,GtkPackType packing
,GtkResponseType response_id
);
Allows a button to be added to the GtkActionBar of the dialog with a custom response id.
dialog |
||
button |
a GtkButton to add |
|
packing |
the GtkPackType to specify start or end packing to the action bar |
|
response_id |
the dialog response id to return when this button is clicked. |
gchar *
xapp_icon_chooser_dialog_get_default_icon
(XAppIconChooserDialog *dialog
);
Returns the default icon (if set).
void xapp_icon_chooser_dialog_set_default_icon (XAppIconChooserDialog *dialog
,const gchar *icon
);
Sets the default icon. If icon
is not NULL, a button will be shown that
will reset the dialog to it's default value.
void xapp_icon_chooser_dialog_add_custom_category (XAppIconChooserDialog *dialog
,const gchar *name
,GList *icons
);
Adds a custom category to the dialog.
#define XAPP_TYPE_ICON_CHOOSER_DIALOG (xapp_icon_chooser_dialog_get_type ())
“allow-paths”
property“allow-paths” gboolean
Whether to allow paths to be searched and selected or only icon names.
Owner: XAppIconChooserDialog
Flags: Read / Write
Default value: TRUE
“default-icon”
property “default-icon” char *
The icon to use by default.
Owner: XAppIconChooserDialog
Flags: Read / Write
Default value: NULL
“icon-size”
property“icon-size” XAppIconSize
The preferred size to use when looking up icons. This only works with icon names. Additionally, there is no guarantee that a selected icon name will exist in a particular size.
Owner: XAppIconChooserDialog
Flags: Read / Write
Default value: XAPP_ICON_SIZE_32
“close”
signalvoid user_function (XAppIconChooserDialog *xappiconchooserdialog, gpointer user_data)
Flags: Action
“select”
signalvoid user_function (XAppIconChooserDialog *xappiconchooserdialog, gpointer user_data)
Flags: Action