From f3927bf5d3f7b876f0c83ab8acf2649822f39efd Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 22 Sep 2003 23:02:36 +0000 Subject: [PATCH] Changes when/how the wxApp object is created. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23842 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wxPython/tools/img2img.py | 5 ----- wxPython/wxPython/tools/img2png.py | 3 +++ wxPython/wxPython/tools/img2py.py | 4 ++++ wxPython/wxPython/tools/img2xpm.py | 3 +++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/wxPython/wxPython/tools/img2img.py b/wxPython/wxPython/tools/img2img.py index 202b731276..a405fb112c 100644 --- a/wxPython/wxPython/tools/img2img.py +++ b/wxPython/wxPython/tools/img2img.py @@ -13,11 +13,6 @@ import sys, os, glob, getopt from wxPython.wx import * -if wxPlatform == "__WXGTK__": - # some bitmap related things need to have a wxApp initialized... - app = wxPySimpleApp() - -wxInitAllImageHandlers() def convert(file, maskClr, outputDir, outputName, outType, outExt): if os.path.splitext(file)[1].lower() == ".ico": diff --git a/wxPython/wxPython/tools/img2png.py b/wxPython/wxPython/tools/img2png.py index 2ddfee329e..60201a4cf3 100644 --- a/wxPython/wxPython/tools/img2png.py +++ b/wxPython/wxPython/tools/img2png.py @@ -37,6 +37,9 @@ import img2img from wxPython import wx def main(): + # some bitmap related things need to have a wxApp initialized... + if wx.wxGetApp() is None: + app = wx.wxPySimpleApp() img2img.main(sys.argv[1:], wx.wxBITMAP_TYPE_PNG, ".png", __doc__) if __name__ == '__main__': diff --git a/wxPython/wxPython/tools/img2py.py b/wxPython/wxPython/tools/img2py.py index 719b19d483..bd510ff3e9 100644 --- a/wxPython/wxPython/tools/img2py.py +++ b/wxPython/wxPython/tools/img2py.py @@ -115,6 +115,10 @@ def main(args): print __doc__ return + # some bitmap related things need to have a wxApp initialized... + if wx.wxGetApp() is None: + app = wx.wxPySimpleApp() + append = 0 compressed = 1 maskClr = None diff --git a/wxPython/wxPython/tools/img2xpm.py b/wxPython/wxPython/tools/img2xpm.py index e49bff180a..08c1b97437 100644 --- a/wxPython/wxPython/tools/img2xpm.py +++ b/wxPython/wxPython/tools/img2xpm.py @@ -37,6 +37,9 @@ import img2img from wxPython import wx def main(): + # some bitmap related things need to have a wxApp initialized... + if wx.wxGetApp() is None: + app = wx.wxPySimpleApp() img2img.main(sys.argv[1:], wx.wxBITMAP_TYPE_XPM, ".xpm", __doc__)