X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4c3b4ed07f8d33e70baa4e66ca43dd0ab834578b..54946cc95b8493fb092b6a508bf22a1cd6fa4693:/wxPython/demo/wxMimeTypesManager.py diff --git a/wxPython/demo/wxMimeTypesManager.py b/wxPython/demo/wxMimeTypesManager.py index 4a830181b6..5768ba2592 100644 --- a/wxPython/demo/wxMimeTypesManager.py +++ b/wxPython/demo/wxMimeTypesManager.py @@ -2,6 +2,7 @@ import pprint, string, os from wxPython.wx import * from mimetypes_wdr import * +from Main import opj #---------------------------------------------------------------------------- @@ -75,8 +76,12 @@ class MimeTypesTestPanel(wxPanel): self.GetExtensionsTxt().SetValue(str(ft.GetExtensions())) self.GetDescriptionTxt().SetValue(str(ft.GetDescription())) - ext = ft.GetExtensions()[0] - if ext[0] == ".": ext = ext[1:] + extList = ft.GetExtensions() + if extList: + ext = extList[0] + if ext[0] == ".": ext = ext[1:] + else: + ext = "" filename = "SPAM" + "." + ext mime = ft.GetMimeType() or "" cmd = ft.GetOpenCommand(filename, mime) @@ -160,9 +165,10 @@ overview = """\ import mimetypes_wdr +import images def MyBitmapsFunc( index ): - return wxImage( "bitmaps/noicon.png", wxBITMAP_TYPE_PNG ).ConvertToBitmap() + return images.getNoIconBitmap() mimetypes_wdr.MyBitmapsFunc = MyBitmapsFunc