Converts code to Gtk 3.0. The GUI is back ready to take off

This commit is contained in:
2012-07-17 13:42:05 +02:00
parent 2a0406982e
commit 4477735d12

24
Ivolution.py Normal file → Executable file
View File

@@ -1,24 +1,20 @@
#!/usr/bin/env python
# First run tutorial.glade through gtk-builder-convert with this command:
# gtk-builder-convert tutorial.glade tutorial.xml
# Then save this file as tutorial.py and make it executable using this command:
# chmod a+x tutorial.py
# And execute it:
# ./tutorial.py
import pygtk
pygtk.require("2.0")
import gtk
from gi.repository import Gtk
class Ivolution(object):
def __init__(self):
builder = gtk.Builder()
builder.add_from_file("data/ui/ivolution_window.xml")
builder = Gtk.Builder()
builder.add_from_file("data/ui/IvolutionWindow.glade")
#builder.connect_signals({ "on_window_destroy" : gtk.main_quit })
self.window = builder.get_object("window")
self.window = builder.get_object("ivolution_window")
self.window.show()
def on_destroy(self, widget, data=None):
"""Called when the IvolutionWindow is closed."""
# Clean up code for saving application state should be added here.
Gtk.main_quit()
if __name__ == "__main__":
app = Ivolution()
gtk.main()ivolution_window.xml
Gtk.main()