:right-sidebar: True AppChooserWidget =================================================================== .. currentmodule:: gi.repository.Gtk .. deprecated:: 4.10 The application selection widgets should be implemented according to the design of each platform and/or application requiring them. .. class:: AppChooserWidget(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.AppChooser`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` ``GtkAppChooserWidget`` is a widget for selecting applications. It is the main building block for :obj:`~gi.repository.Gtk.AppChooserDialog`. Most applications only need to use the latter; but you can use this widget as part of a larger widget if you have special needs. ``GtkAppChooserWidget`` offers detailed control over what applications are shown, using the :obj:`~gi.repository.Gtk.AppChooserWidget.props.show_default`, :obj:`~gi.repository.Gtk.AppChooserWidget.props.show_recommended`, :obj:`~gi.repository.Gtk.AppChooserWidget.props.show_fallback`, :obj:`~gi.repository.Gtk.AppChooserWidget.props.show_other` and :obj:`~gi.repository.Gtk.AppChooserWidget.props.show_all` properties. See the :obj:`~gi.repository.Gtk.AppChooser` documentation for more information about these groups of applications. To keep track of the selected application, use the :obj:`~gi.repository.Gtk.AppChooserWidget.signals.application_selected` and :obj:`~gi.repository.Gtk.AppChooserWidget.signals.application_activated` signals. CSS nodes --------- ``GtkAppChooserWidget`` has a single CSS node with name appchooser. Constructors ------------ .. rst-class:: interim-class .. class:: AppChooserWidget :no-index: .. classmethod:: new(content_type: str) -> ~gi.repository.Gtk.Widget Creates a new ``GtkAppChooserWidget`` for applications that can handle content of the given type. .. deprecated:: 4.10 This widget will be removed in GTK 5 :param content_type: the content type to show applications for Methods ------- .. rst-class:: interim-class .. class:: AppChooserWidget :no-index: .. method:: get_default_text() -> str | None Returns the text that is shown if there are not applications that can handle the content type. .. deprecated:: 4.10 This widget will be removed in GTK 5 .. method:: get_show_all() -> bool Gets whether the app chooser should show all applications in a flat list. .. deprecated:: 4.10 This widget will be removed in GTK 5 .. method:: get_show_default() -> bool Gets whether the app chooser should show the default handler for the content type in a separate section. .. deprecated:: 4.10 This widget will be removed in GTK 5 .. method:: get_show_fallback() -> bool Gets whether the app chooser should show related applications for the content type in a separate section. .. deprecated:: 4.10 This widget will be removed in GTK 5 .. method:: get_show_other() -> bool Gets whether the app chooser should show applications which are unrelated to the content type. .. deprecated:: 4.10 This widget will be removed in GTK 5 .. method:: get_show_recommended() -> bool Gets whether the app chooser should show recommended applications for the content type in a separate section. .. deprecated:: 4.10 This widget will be removed in GTK 5 .. method:: set_default_text(text: str) -> None Sets the text that is shown if there are not applications that can handle the content type. .. deprecated:: 4.10 This widget will be removed in GTK 5 :param text: the new value for :obj:`~gi.repository.Gtk.AppChooserWidget.props.default_text` .. method:: set_show_all(setting: bool) -> None Sets whether the app chooser should show all applications in a flat list. .. deprecated:: 4.10 This widget will be removed in GTK 5 :param setting: the new value for :obj:`~gi.repository.Gtk.AppChooserWidget.props.show_all` .. method:: set_show_default(setting: bool) -> None Sets whether the app chooser should show the default handler for the content type in a separate section. .. deprecated:: 4.10 This widget will be removed in GTK 5 :param setting: the new value for :obj:`~gi.repository.Gtk.AppChooserWidget.props.show_default` .. method:: set_show_fallback(setting: bool) -> None Sets whether the app chooser should show related applications for the content type in a separate section. .. deprecated:: 4.10 This widget will be removed in GTK 5 :param setting: the new value for :obj:`~gi.repository.Gtk.AppChooserWidget.props.show_fallback` .. method:: set_show_other(setting: bool) -> None Sets whether the app chooser should show applications which are unrelated to the content type. .. deprecated:: 4.10 This widget will be removed in GTK 5 :param setting: the new value for :obj:`~gi.repository.Gtk.AppChooserWidget.props.show_other` .. method:: set_show_recommended(setting: bool) -> None Sets whether the app chooser should show recommended applications for the content type in a separate section. .. deprecated:: 4.10 This widget will be removed in GTK 5 :param setting: the new value for :obj:`~gi.repository.Gtk.AppChooserWidget.props.show_recommended` Properties ---------- .. rst-class:: interim-class .. class:: AppChooserWidget :no-index: .. attribute:: props.default_text :type: str The text that appears in the widget when there are no applications for the given content type. .. attribute:: props.show_all :type: bool If :const:`True`, the app chooser presents all applications in a single list, without subsections for default, recommended or related applications. .. attribute:: props.show_default :type: bool Determines whether the app chooser should show the default handler for the content type in a separate section. If :const:`False`, the default handler is listed among the recommended applications. .. attribute:: props.show_fallback :type: bool Determines whether the app chooser should show a section for fallback applications. If :const:`False`, the fallback applications are listed among the other applications. .. attribute:: props.show_other :type: bool Determines whether the app chooser should show a section for other applications. .. attribute:: props.show_recommended :type: bool Determines whether the app chooser should show a section for recommended applications. If :const:`False`, the recommended applications are listed among the other applications. Signals ------- .. rst-class:: interim-class .. class:: AppChooserWidget.signals :no-index: .. method:: application_activated(application: ~gi.repository.Gio.AppInfo) -> None Emitted when an application item is activated from the widget's list. This usually happens when the user double clicks an item, or an item is selected and the user presses one of the keys Space, Shift+Space, Return or Enter. :param application: the activated ``GAppInfo`` .. method:: application_selected(application: ~gi.repository.Gio.AppInfo) -> None Emitted when an application item is selected from the widget's list. :param application: the selected ``GAppInfo``