XApp.IconChooserDialog¶
- Subclasses:
None
Methods¶
- Inherited:
XApp.GtkWindow (5), Gtk.Window (119), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
Whether to allow paths. |
||
r/w/en |
The icon to use by default |
||
r/w/en |
The preferred icon size. |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Gtk.Window (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Gtk.Window (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Class Details¶
- class XApp.IconChooserDialog(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a newly created
XApp.IconChooserDialog
- Return type:
Creates a new
XApp.IconChooserDialog
.
- add_button(button, packing, response_id)¶
- Parameters:
button (
Gtk.Widget
) – aGtk.Button
to addpacking (
Gtk.PackType
) – theGtk.PackType
to specify start or end packing to the action barresponse_id (
Gtk.ResponseType
) – the dialog response id to return when this button is clicked.
Allows a button to be added to the
Gtk.ActionBar
of the dialog with a custom response id.
- add_custom_category(name, icons)¶
- Parameters:
Adds a custom category to the dialog.
- get_default_icon()¶
-
Returns the default icon (if set).
- get_icon_string()¶
- Returns:
the string representation of the currently selected icon or
None
if no icon is selected.- Return type:
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.
- run()¶
- Returns:
Gtk.ResponseType.OK
if the user selected an icon, orGtk.ResponseType.CANCEL
otherwise- Return type:
Shows the dialog and enters a separate main loop until an icon is chosen or the action is canceled.
XApp.IconChooserDialog.run
(),XApp.IconChooserDialog.run_with_icon
(), andXApp.IconChooserDialog.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.
- run_with_category(category)¶
- Parameters:
category (
str
) –- Returns:
Gtk.ResponseType.OK
if the user selected an icon, orGtk.ResponseType.CANCEL
otherwise- Return type:
Like
XApp.IconChooserDialog.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, useGtk.IconTheme.list_contexts
().XApp.IconChooserDialog.run
(),XApp.IconChooserDialog.run_with_icon
(), andXApp.IconChooserDialog.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.
- run_with_icon(icon)¶
- Parameters:
icon (
str
) – a string representing the icon that should be selected- Returns:
Gtk.ResponseType.OK
if the user selected an icon, orGtk.ResponseType.CANCEL
otherwise- Return type:
Like
XApp.IconChooserDialog.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.IconChooserDialog.run
(),XApp.IconChooserDialog.run_with_icon
(), andXApp.IconChooserDialog.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.
Signal Details¶
- XApp.IconChooserDialog.signals.close(icon_chooser_dialog)¶
- Signal Name:
close
- Flags:
- Parameters:
icon_chooser_dialog (
XApp.IconChooserDialog
) – The object which received the signal
- XApp.IconChooserDialog.signals.select(icon_chooser_dialog)¶
- Signal Name:
select
- Flags:
- Parameters:
icon_chooser_dialog (
XApp.IconChooserDialog
) – The object which received the signal
Property Details¶
- XApp.IconChooserDialog.props.allow_paths¶
- Name:
allow-paths
- Type:
- Default Value:
- Flags:
Whether to allow paths to be searched and selected or only icon names.
- XApp.IconChooserDialog.props.default_icon¶
- Name:
default-icon
- Type:
- Default Value:
- Flags:
The icon to use by default.
- XApp.IconChooserDialog.props.icon_size¶
- Name:
icon-size
- Type:
- Default Value:
- Flags:
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.