[seed] Update vte-test example style, and remove old Gtk.main_quit hack
- From: Robert Carr <racarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] Update vte-test example style, and remove old Gtk.main_quit hack
- Date: Tue, 28 Apr 2009 16:11:42 -0400 (EDT)
commit 33236526dca506b8e75d838682b59df3b8a7a76a
Author: Robert Carr <racarr svn gnome org>
Date: Tue Apr 28 16:07:53 2009 -0400
Update vte-test example style, and remove old Gtk.main_quit hack
---
examples/soup.js | 2 +-
examples/vte-test.js | 42 +++++++++++++++++++-----------------------
2 files changed, 20 insertions(+), 24 deletions(-)
diff --git a/examples/soup.js b/examples/soup.js
index e0733d3..27e92bb 100755
--- a/examples/soup.js
+++ b/examples/soup.js
@@ -5,7 +5,7 @@ Soup = imports.gi.Soup;
var session = new Soup.SessionSync();
// Soup.URI is a struct.
-var uri = Soup.URI.c_new("http://www.google.com");
+var uri = new Soup.URI.c_new("http://www.google.com");
var request = new Soup.Message({method:"GET", uri:uri});
var status = session.send_message(request);
diff --git a/examples/vte-test.js b/examples/vte-test.js
index 28f3a42..1709845 100755
--- a/examples/vte-test.js
+++ b/examples/vte-test.js
@@ -3,33 +3,29 @@
Gtk = imports.gi.Gtk;
Vte = imports.gi.Vte;
-with (Gtk)
-{
- init(null, null);
-
- var window = new Window();
- window.signal.hide.connect(function () { Gtk.main_quit(); } );
+Gtk.init(null, null);
- var scroll = new ScrolledWindow();
+var window = new Gtk.Window();
+window.signal.hide.connect(Gtk.main_quit);
- var vte = new Vte.Terminal();
- vte.fork_command("/bin/bash");
- vte.signal.child_exited.connect(function(){main_quit();});
- vte.signal.window_title_changed.connect
- (function(terminal)
- {
- window.set_title(terminal.get_window_title());
- });
+var scroll = new Gtk.ScrolledWindow();
+var vte = new Vte.Terminal();
+vte.fork_command("/bin/bash");
+vte.signal.child_exited.connect(Gtk.main_quit);
+vte.signal.window_title_changed.connect(
+ function(terminal){
+ window.set_title(terminal.get_window_title());
+ });
- scroll.add(vte);
- scroll.set_policy(PolicyType.AUTOMATIC,
- PolicyType.AUTOMATIC);
- window.add(scroll);
- window.resize(600,400);
- window.show_all();
+scroll.add(vte);
+scroll.set_policy(Gtk.PolicyType.AUTOMATIC,
+ Gtk.PolicyType.AUTOMATIC);
- main();
+window.add(scroll);
+window.resize(600,400);
+window.show_all();
+
+Gtk.main();
-}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]