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__)