Skip to content

Instantly share code, notes, and snippets.

@craigcabrey
Created February 21, 2016 22:55
Show Gist options
  • Save craigcabrey/cea560f4823f69211bd8 to your computer and use it in GitHub Desktop.
Save craigcabrey/cea560f4823f69211bd8 to your computer and use it in GitHub Desktop.
#!/usr/bin/gjs
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const AppChooserWidgetTest = new Lang.Class({
Name: 'AppChooserWidgetTest',
_init: function() {
this.application = new Gtk.Application();
this.application.connect('activate', Lang.bind(this, this._onActivate));
this.application.connect('startup', Lang.bind(this, this._onStartup));
},
_onActivate: function() {
this._window.present();
},
_onStartup: function() {
this._window = new Gtk.ApplicationWindow({
application: this.application,
title: 'AppChooserWidgetTest',
default_height: 200,
default_width: 400,
window_position: Gtk.WindowPosition.CENTER
});
this._window.add(new Gtk.AppChooserWidget({show_all: true}));
this._window.show_all();
}
});
const app = new AppChooserWidgetTest();
app.application.run(ARGV);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment