]> git.saurik.com Git - wxWidgets.git/commitdiff
Make the app object be global in case it is run multiple times, such
authorRobin Dunn <robin@alldunn.com>
Wed, 10 May 2006 23:22:27 +0000 (23:22 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 10 May 2006 23:22:27 +0000 (23:22 +0000)
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
wxPython/wx/tools/img2py.py
wxPython/wx/tools/img2xpm.py

index 2f5bc8baab0620161c15b1dcef7762e7ba7f744e..69fa69c12d9ddf01e00d2e47582194c26d3e2467 100644 (file)
@@ -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__)
 
index b4f6b4c9e4ea1b7396f1b8903178364c2d290a27..71a6099b6d9f5df9ab1eb25fde0a5186ca4df247 100644 (file)
@@ -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
index 3fa833b0cea347a894cc146160fcfc15f078796b..9907d1d617c43807fbda839a5b1a9b4316c306b7 100644 (file)
@@ -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__)