Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Gtk = imports.gi.Gtk;
- const GLib = imports.gi.GLib;
- const Vte = imports.gi.Vte;
- // Initialize the gtk
- Gtk.init(null, 0);
- let mwindow = new Gtk.Window ({type : Gtk.WindowType.TOPLEVEL});
- let label = new Gtk.Label ({label : "Hello World"});
- let terminal = new Vte.Terminal ();
- let pty = terminal.pty_new (Vte.PtyFlags.DEFAULT);
- terminal.set_pty_object (pty);
- //var argv = [];
- //terminal.fork_command_full (Vte.PtyFlags.DEFAULT, null, argv, null, GLib.SpawnFlags.DO_NOT_REPEAT_CHILD, null, null, null);
- // Set the window title
- mwindow.title = "Hello World!";
- mwindow.connect ("destroy", function(){Gtk.main_quit()});
- // Add the label
- mwindow.add (terminal);
- // Show the widgets
- mwindow.show_all();
- Gtk.main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement