]> git.siccegge.de Git - ghextris.git/commitdiff
Start migrating code to builder
authorChristoph Egger <christoph@christoph-egger.org>
Wed, 19 Aug 2015 18:50:19 +0000 (20:50 +0200)
committerChristoph Egger <christoph@christoph-egger.org>
Wed, 19 Aug 2015 18:50:19 +0000 (20:50 +0200)
ghextris.py

index aae179850fb0fdcf486a6075486473fe4616b7b4..5fb037d4fec43fa415587074f0c5ff24a7ae8537 100755 (executable)
@@ -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,