AppChooserWidget


Object Hierarchy:

Gtk.AppChooserWidget Gtk.AppChooserWidget Gtk.AppChooserWidget Gtk.Box Gtk.Box Gtk.Box->Gtk.AppChooserWidget Gtk.Container Gtk.Container Gtk.Container->Gtk.Box Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.Container GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Atk.Implementor Atk.Implementor Atk.Implementor->Gtk.AppChooserWidget Atk.Implementor->Gtk.Box Atk.Implementor->Gtk.Container Atk.Implementor->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.AppChooserWidget Gtk.Buildable->Gtk.Box Gtk.Buildable->Gtk.Container Gtk.Buildable->Gtk.Widget Gtk.Orientable Gtk.Orientable Gtk.Orientable->Gtk.AppChooserWidget Gtk.Orientable->Gtk.Box Gtk.AppChooser Gtk.AppChooser Gtk.AppChooser->Gtk.AppChooserWidget

Description:

[ CCode ( type_id = "gtk_app_chooser_widget_get_type ()" ) ]
public class AppChooserWidget : Box, Implementor, AppChooser, Buildable, Orientable

AppChooserWidget is a widget for selecting applications.

It is the main building block for 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.

AppChooserWidget offers detailed control over what applications are shown, using the show_default, show_recommended, show_fallback, show_other and show_all properties. See the AppChooser documentation for more information about these groups of applications.

To keep track of the selected application, use the application_selected and application_activated signals.

CSS nodes

GtkAppChooserWidget has a single CSS node with name appchooser.

Example: AppChooserWidget:

public class Application : Gtk.Window {
private void print_selection (string title, Gtk.AppChooserWidget widget) {
AppInfo info = widget.get_app_info ();
if (info != null) {
print ("%s:\n", title);
print (" Name: %s\n", info.get_display_name ());
print (" Desc: %s\n", info.get_description ());
}
}

public Application () {
// Prepare Gtk.Window:
this.title = "My Gtk.AppChooserWidget";
this.window_position = Gtk.WindowPosition.CENTER;
this.destroy.connect (Gtk.main_quit);

// The button:
Gtk.AppChooserWidget widget = new Gtk.AppChooserWidget ("image/png");
this.add (widget);

// Catch all selections:
widget.application_activated.connect (() => {
print_selection ("Activated", widget);
});

widget.application_selected.connect (() => {
print_selection ("Selected", widget);
});
}

public static int main (string[] args) {
Gtk.init (ref args);

Application app = new Application ();
app.show_all ();
Gtk.main ();
return 0;
}
}

valac --pkg gtk+-3.0 Gtk.AppChooserWidget.vala

Namespace: Gtk
Package: gtk+-3.0

Content:

Properties:

Creation methods:

Methods:

Signals:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
All known members inherited from interface Atk.Implementor
All known members inherited from interface Gtk.AppChooser
All known members inherited from interface Gtk.Orientable



2022 vala-language.org