diff options
author | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2005-02-17 14:17:18 +0000 |
---|---|---|
committer | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2005-02-17 14:17:18 +0000 |
commit | 1b1138360fc203be9d089b634b84e5a03d4ee32b (patch) | |
tree | f5a828c1bd5d77580d4d49f939f9aef25d0e4057 | |
parent | 80efb71faf24d9dd809a83b3b2cb248b434cc277 (diff) | |
download | pygtk-1b1138360fc203be9d089b634b84e5a03d4ee32b.tar.gz |
gtk.AboutDialog example
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | examples/pygtk-demo/demos/appwindow.py | 10 |
2 files changed, 16 insertions, 1 deletions
@@ -1,3 +1,10 @@ +2005-02-16 Gustavo J. A. M. Carneiro <gjc@gnome.org> + + * examples/pygtk-demo/demos/appwindow.py + (ApplicationMainWindowDemo.activate_about) + (ApplicationMainWindowDemo.__create_action_group): Popup a simple + AboutDialog on Help->About. + 2005-02-15 Johan Dahlin <johan@gnome.org> * configure.in: Fix logic when displaying modules not built, diff --git a/examples/pygtk-demo/demos/appwindow.py b/examples/pygtk-demo/demos/appwindow.py index c12b5b2b..f1365dd6 100644 --- a/examples/pygtk-demo/demos/appwindow.py +++ b/examples/pygtk-demo/demos/appwindow.py @@ -201,7 +201,7 @@ class ApplicationMainWindowDemo(gtk.Window): ( "About", None, # name, stock id "_About", "<control>A", # label, accelerator "About", # tooltip - self.activate_action ), + self.activate_about ), ( "Logo", "demo-gtk-logo", # name, stock id None, None, # label, accelerator "GTK+", # tooltip @@ -252,6 +252,14 @@ class ApplicationMainWindowDemo(gtk.Window): return action_group + def activate_about(self, action): + dialog = gtk.AboutDialog() + dialog.set_name("PyGTK Demo") + dialog.set_copyright("\302\251 Copyright 200x the PyGTK Team") + dialog.set_website("http://www.pygtk.org./") + ## Close dialog on user response + dialog.connect ("response", lambda d, r: d.destroy()) + dialog.show() def activate_action(self, action): dialog = gtk.MessageDialog(self, gtk.DIALOG_DESTROY_WITH_PARENT, |