mirror of
https://github.com/jlengrand/Ivolution.git
synced 2026-03-10 08:21:18 +00:00
Converts code to Gtk 3.0. The GUI is back ready to take off
This commit is contained in:
24
Ivolution.py
Normal file → Executable file
24
Ivolution.py
Normal file → Executable 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()
|
||||
Reference in New Issue
Block a user