[seed] Update accelgroup example to use more...modern seed
- From: Robert Carr <racarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] Update accelgroup example to use more...modern seed
- Date: Tue, 28 Apr 2009 16:09:51 -0400 (EDT)
commit ee922caef45a1055f187253bb00c1613ec4b8d7b
Author: Robert Carr <racarr svn gnome org>
Date: Tue Apr 28 15:31:59 2009 -0400
Update accelgroup example to use more...modern seed
---
examples/accelgroup.js | 30 +++++++++++-------------------
1 files changed, 11 insertions(+), 19 deletions(-)
diff --git a/examples/accelgroup.js b/examples/accelgroup.js
index 71366b9..8614c0f 100755
--- a/examples/accelgroup.js
+++ b/examples/accelgroup.js
@@ -3,27 +3,19 @@
Gtk = imports.gi.Gtk;
Gdk = imports.gi.Gdk;
-with (Gtk)
-{
- init(null, null);
+Gtk.init(null, null);
- var quit = function ()
- {
- main_quit();
- };
+var w = new Gtk.Window();
+w.signal.hide.connect(Gtk.main_quit);
- var w = new Window();
- w.signal.hide.connect(quit);
+var group = new Gtk.AccelGroup();
+group.connect(Gdk.keyval_from_name("q"), 0, 0, Gtk.main_quit);
+w.add_accel_group(group);
- var group = new AccelGroup();
- group.connect(Gdk.keyval_from_name("q"), 0, 0, quit);
- w.add_accel_group(group);
+var label = new Gtk.Label({label: "Press Q to quit"});
+w.add(label);
- var label = new Label({label: "Press Q to quit"});
- w.add(label);
+w.resize(300, 300);
+w.show_all();
- w.resize(300, 300);
- w.show_all();
-
- main();
-}
+Gtk.main();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]