From 5d2c0edfe55ab235a0d72820becac80cbcca00df Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Wed, 19 Aug 2015 20:50:19 +0200 Subject: [PATCH] Start migrating code to builder --- ghextris.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ghextris.py b/ghextris.py index aae1798..5fb037d 100755 --- a/ghextris.py +++ b/ghextris.py @@ -33,7 +33,6 @@ import gnomecanvas import gnome import gnome.ui from gi.repository import GObject -import Gtk.glade import gettext @@ -229,7 +228,7 @@ class Hextris: return True def on_about_activate(self, event): - aTree = Gtk.glade.XML(self.glade, "about") + aTree = self.builder.get_object("about") about = aTree.get_widget("about") about.set_property("name", "Ghextris") about.set_property("version", VERSION) @@ -250,9 +249,9 @@ class Hextris: def main(self): gnome.init("Ghextris", VERSION) gettext.install("ghextris") - self.glade = os.path.join(SHAREDIR, "ghextris.glade") - - wTree = Gtk.glade.XML(self.glade, "GhextrisApp") + self.builder = Gtk.Builder() + self.builder.add_from_file(os.path.join(SHAREDIR, "ghextris.builder")) + wTree =self.builder.get_object("GhextrisApp") dic = {"on_new_activate": self.on_new_activate, "on_pause_game_activate": self.on_pause_game_activate, "on_quit_activate": self.on_quit_activate, -- 2.39.5