AppChooserDialog

Deprecated since version 4.10: The application selection widgets should be implemented according to the design of each platform and/or application requiring them.

class AppChooserDialog(*args, **kwargs)

Superclasses: Dialog, Window, Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, AppChooser, Buildable, ConstraintTarget, Native, Root, ShortcutManager

GtkAppChooserDialog shows a GtkAppChooserWidget inside a GtkDialog.

https://docs.gtk.org/gtk4/appchooserdialog.png

Note that GtkAppChooserDialog does not have any interesting methods of its own. Instead, you should get the embedded GtkAppChooserWidget using get_widget and call its methods if the generic AppChooser interface is not sufficient for your needs.

To set the heading that is shown above the GtkAppChooserWidget, use set_heading.

CSS nodes

GtkAppChooserDialog has a single CSS node with the name window and style class .appchooser.

Constructors

class AppChooserDialog
classmethod new(parent: Window | None, flags: DialogFlags, file: File) Widget

Creates a new GtkAppChooserDialog for the provided GFile.

The dialog will show applications that can open the file.

Deprecated since version 4.10: This widget will be removed in GTK 5

Parameters:
  • parent – a GtkWindow

  • flags – flags for this dialog

  • file – a GFile

classmethod new_for_content_type(parent: Window | None, flags: DialogFlags, content_type: str) Widget

Creates a new GtkAppChooserDialog for the provided content type.

The dialog will show applications that can open the content type.

Deprecated since version 4.10: This widget will be removed in GTK 5

Parameters:
  • parent – a GtkWindow

  • flags – flags for this dialog

  • content_type – a content type string

Methods

class AppChooserDialog
get_heading() str | None

Returns the text to display at the top of the dialog.

Deprecated since version 4.10: This widget will be removed in GTK 5

get_widget() Widget

Returns the GtkAppChooserWidget of this dialog.

Deprecated since version 4.10: This widget will be removed in GTK 5

set_heading(heading: str) None

Sets the text to display at the top of the dialog.

If the heading is not set, the dialog displays a default text.

Deprecated since version 4.10: This widget will be removed in GTK 5

Parameters:

heading – a string containing Pango markup

Properties

class AppChooserDialog
props.gfile: File

The GFile used by the GtkAppChooserDialog.

The dialog’s GtkAppChooserWidget content type will be guessed from the file, if present.

props.heading: str

The text to show at the top of the dialog.

The string may contain Pango markup.