Gtk Basic Window Creation

主要範例

程式碼

#!/usr/bin/gjs

const Gtk = imports.gi.Gtk;

Gtk.init(null, null);

var win = Gtk.Window.new(Gtk.WindowType.TOPLEVEL);
win.connect('delete-event', Gtk.main_quit);
win.show_all();

Gtk.main();

API

WindowType

  • Gtk.WindowType.TOPLEVEL
  • Gtk.WindowType.POPUP

更多參考