Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!

gjs and Gtk+

By: diegotoral on Sep 25th, 2011  |  syntax: JavaScript  |  size: 0.45 KB  |  views: 12,136  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. const Gtk = imports.gi.Gtk;
  2. const GLib = imports.gi.GLib;
  3.  
  4. // Initialize the gtk
  5. Gtk.init(null, 0);
  6.  
  7. let mwindow = new Gtk.Window ({type : Gtk.WindowType.TOPLEVEL});
  8. let label = new Gtk.Label ({label : "Hello World"});
  9.  
  10. // Set the window title
  11. mwindow.title = "Hello World!";
  12. mwindow.connect ("destroy", function(){Gtk.main_quit()});
  13.  
  14. // Add the label
  15. mwindow.add (label);
  16.  
  17. // Show the widgets
  18. label.show ();
  19. mwindow.show();
  20.  
  21. Gtk.main();