From 2240b1aa740739e35e646016511fc8a3302104a4 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 10 May 2006 23:22:27 +0000 Subject: [PATCH] Make the app object be global in case it is run multiple times, such as from encode_bitmaps. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39136 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wx/tools/img2png.py | 3 ++- wxPython/wx/tools/img2py.py | 3 ++- wxPython/wx/tools/img2xpm.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wxPython/wx/tools/img2png.py b/wxPython/wx/tools/img2png.py index 2f5bc8baab..69fa69c12d 100644 --- a/wxPython/wx/tools/img2png.py +++ b/wxPython/wx/tools/img2png.py @@ -40,10 +40,11 @@ import sys import wx import img2img - +app = None def main(): # some bitmap related things need to have a wxApp initialized... if wx.GetApp() is None: + global app app = wx.PySimpleApp() img2img.main(sys.argv[1:], wx.BITMAP_TYPE_PNG, ".png", __doc__) diff --git a/wxPython/wx/tools/img2py.py b/wxPython/wx/tools/img2py.py index b4f6b4c9e4..71a6099b6d 100644 --- a/wxPython/wx/tools/img2py.py +++ b/wxPython/wx/tools/img2py.py @@ -124,7 +124,7 @@ def crunch_data(data, compressed): return fp.getvalue() - +app = None def main(args): if not args or ("-h" in args): print __doc__ @@ -132,6 +132,7 @@ def main(args): # some bitmap related things need to have a wxApp initialized... if wx.GetApp() is None: + global app app = wx.PySimpleApp() append = 0 diff --git a/wxPython/wx/tools/img2xpm.py b/wxPython/wx/tools/img2xpm.py index 3fa833b0ce..9907d1d617 100644 --- a/wxPython/wx/tools/img2xpm.py +++ b/wxPython/wx/tools/img2xpm.py @@ -36,14 +36,14 @@ Options: """ import sys - import wx - import img2img +app = None def main(): # some bitmap related things need to have a wxApp initialized... if wx.GetApp() is None: + global app app = wx.PySimpleApp() img2img.main(sys.argv[1:], wx.BITMAP_TYPE_XPM, ".xpm", __doc__) -- 2.45.2