Advertisement
diegotoral

gjs and Gtk+

Sep 25th, 2011
19,555
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement