[pygobject] [gtk-demo] appwindow.py: fix logo loading



commit 7fe10a5b33148b1f029f3d34f76b7f880c1c2e7a
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Mon Aug 22 07:58:25 2011 +0200

    [gtk-demo] appwindow.py: fix logo loading

 demos/gtk-demo/demos/appwindow.py |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/demos/gtk-demo/demos/appwindow.py b/demos/gtk-demo/demos/appwindow.py
index 1ab7c51..b39751d 100644
--- a/demos/gtk-demo/demos/appwindow.py
+++ b/demos/gtk-demo/demos/appwindow.py
@@ -115,13 +115,9 @@ License along with the Gnome Library; see the file COPYING.LIB.  If not,
 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.
 """
-    filename = os.path.join('data', 'gtk-logo-rgb.gif')
-    try:
-        pixbuf = GdkPixbuf.Pixbuf.new_from_file(filename)
-    except GLib.GError:
-        filename = os.path.join('demos', filename)
-        pixbuf = GdkPixbuf.Pixbuf.new_from_file(filename)
-
+    dirname = os.path.abspath(os.path.dirname(__file__))
+    filename = os.path.join(dirname, 'data', 'gtk-logo-rgb.gif')
+    pixbuf = GdkPixbuf.Pixbuf.new_from_file(filename)
     transparent = pixbuf.add_alpha(True, 0xff, 0xff, 0xff)
     # FIXME: override Gtk.show_about_dialog
     #        make about dailog constructor take a parent argument



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]