[gnome-games] [same-gnome-clutter] Menu signal handlers
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-games] [same-gnome-clutter] Menu signal handlers
- Date: Thu, 16 Jul 2009 22:32:37 +0000 (UTC)
commit 58e9604566bac2971d1e47092c324e35ba3690d0
Author: Tim Horton <hortont424 gmail com>
Date: Sun Jul 5 21:13:03 2009 -0400
[same-gnome-clutter] Menu signal handlers
same-gnome-clutter/data/same-gnome.ui | 1 +
same-gnome-clutter/src/main.js | 25 +++++++++++++++++++++----
2 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/same-gnome-clutter/data/same-gnome.ui b/same-gnome-clutter/data/same-gnome.ui
index 129b828..4e0e8cb 100644
--- a/same-gnome-clutter/data/same-gnome.ui
+++ b/same-gnome-clutter/data/same-gnome.ui
@@ -2,6 +2,7 @@
<interface>
<requires lib="gtk+" version="2.14"/>
<object class="GtkWindow" id="game_window">
+ <signal name="hide" handler="quit"/>
<property name="title" translatable="yes">Lights Off</property>
<property name="resizable">False</property>
<accel-groups>
diff --git a/same-gnome-clutter/src/main.js b/same-gnome-clutter/src/main.js
index 229705a..429b50e 100755
--- a/same-gnome-clutter/src/main.js
+++ b/same-gnome-clutter/src/main.js
@@ -14,6 +14,7 @@ imports.gi.versions.Clutter = "0.9";
Gtk = imports.gi.Gtk;
GtkClutter = imports.gi.GtkClutter;
+GtkBuilder = imports.gtkbuilder;
Clutter = imports.gi.Clutter;
GdkPixbuf = imports.gi.GdkPixbuf;
GConf = imports.gi.GConf;
@@ -33,14 +34,31 @@ board = imports.board;
score = imports.score;
settings = imports.settings;
+handlers = {
+ show_settings: function(selector, ud)
+ {
+ //Settings.show_settings();
+ },
+ show_about: function(selector, ud)
+ {
+ About.show_about_dialog();
+ },
+ reset_score: function(selector, ud)
+ {
+ board.new_game();
+ },
+ quit: function(selector, ud)
+ {
+ Gtk.main_quit();
+ }
+};
+
b = new Gtk.Builder();
b.add_from_file(settings.file_prefix + "/same-gnome.ui");
-//b.connect_signals(handlers);
+b.connect_signals(handlers);
var window = b.get_object("game_window");
var clutter_embed = b.get_object("clutter");
-window.signal.hide.connect(Gtk.main_quit);
-//b.get_object("game_vbox").pack_start(clutter_embed, true, true);
var stage = clutter_embed.get_stage();
@@ -53,7 +71,6 @@ stage.color = {alpha: 0};
stage.set_size((tiles_w * tile_size),(tiles_h * tile_size));
clutter_embed.set_size_request((tiles_w * tile_size),(tiles_h * tile_size));
-// TODO: determine size of window before we show it
// NOTE: show the window before the stage, and the stage before any children
window.show_all();
stage.show_all();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]