From f041ef633efa52d45a4026b415c05331a1d40af5 Mon Sep 17 00:00:00 2001 From: Stephen Watson Date: Thu, 21 Aug 2003 17:50:36 +0000 Subject: [PATCH] gtk.window_set_default_icon_list() isn't in older versions of pygtk (e.g. 1.99.14) git-svn-id: https://rox.svn.sourceforge.net/svnroot/rox/trunk/ROX-Lib2@3003 66de3db3-b00d-0410-b41b-f4738ad19bea --- python/rox/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/rox/__init__.py b/python/rox/__init__.py index 646980b..cb30947 100644 --- a/python/rox/__init__.py +++ b/python/rox/__init__.py @@ -148,7 +148,12 @@ def report_exception(): _icon_path = os.path.join(app_dir, '.DirIcon') if os.path.exists(_icon_path): - g.window_set_default_icon_list(g.gdk.pixbuf_new_from_file(_icon_path)) + try: + g.window_set_default_icon_list(g.gdk.pixbuf_new_from_file(_icon_path)) + _window_icon=None + except: + # Older pygtk + _window_icon = g.gdk.pixbuf_new_from_file(_icon_path) del _icon_path class Window(g.Window): @@ -160,6 +165,9 @@ class Window(g.Window): toplevel_ref() args[0].connect('destroy', toplevel_unref) + if _window_icon: + args[0].set_icon(_window_icon) + class Dialog(g.Dialog): """This works in exactly the same way as a GtkDialog, except that it calls the toplevel_(un)ref functions for you automatically.""" -- 2.11.4.GIT