/usr/share/doc/python-gtkmvc-doc/examples/website/example1.py is in python-gtkmvc-doc 1.99.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import _importer, gtkmvc, gtk
class MyModel (gtkmvc.Model):
name = "Roberto"
age = 0
__observables__ = ( "name", "age" )
def show(self): print "MyModel: name=", self.name, "age=", self.age
class MyCtrl (gtkmvc.Controller):
def on_button_clicked(self, button):
self.model.show()
return
def on_window_delete_event(self, window, event):
# quits the application
gtk.main_quit()
return True
m = MyModel()
v = gtkmvc.View(glade="example1.glade")
c = MyCtrl(m, v, auto_adapt=True)
gtk.main() # run the application
|