I'm noticing that my MDIParent frame doesn't "take" icons returned from the mimetypesmanager class (it works fine with icons loaded from disk). Is there something I'm missing about one of these two classes?
Here's a simplified version of the code I'm using, when run, the icon remains the default "windows" icon, but if I use the "py.ico" line instead, I get (as expected), a python icon. .doc definitely is registered in the system, and shows up in the mimetypesmanager demo (though there it's converting to a bitmap for display)...
2.3.3pre5, on Win2k, Python 2.2, incidentally.
Ideas anyone?
Mike
from wxPython.wx import *
import os
class MDIEditor(wxMDIParentFrame):
def __init__(
self, parent=NULL, id=-1,
title="Editor",
pos = wxDefaultPosition, size = wxDefaultSize,
style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
name = "editorframe",
):
wxMDIParentFrame.__init__( self, parent, id, title, pos, size, style, name )
type = wxTheMimeTypesManager.GetFileTypeFromExtension('.doc')
self.icon = type.GetIcon()
## self.icon = wxIcon( "py.ico", wxBITMAP_TYPE_ICO )
self.SetIcon( self.icon )
if __name__ == '__main__':
class MyApp(wxApp):
def OnInit(self):
frame = MDIEditor()
frame.Show(true)
self.SetTopWindow(frame)
return true
app = MyApp(0)
app.MainLoop()
···
--
_______________________________________
Mike C. Fletcher
http://members.rogers.com/mcfletch/