From: Andy T. <an...@ha...> - 2004-07-06 08:07:19
|
Tim Black wrote: > One of my apps is using an .ico file that contains all format > permutations including XP, 256, 16 color and 48x48, 32x32, 16x16 pixels. > When I run the app, windows (xp) uses the proper icon format for each > different manifestation (shortcut, taskbar, even my app's console title > bar...), however the icon in the title bar of my Pythoncard app doesn't > seem quite right. It looks like Pythoncard may have just shrunk one of > larger formats from my .ico file. > > > > Can anyone tell me details about how Pythoncard uses the icon file > specified for the background in the .rc file? I mainly would like to > know which size/color formats of the icon file are actually used by the > app. > > > > Thanks, > > Tim > > The simple answer is 'not a lot'. In versions of PythonCard up to 7.3 the relevant code is in model.py. Take a look at the _setIcon method for the Background class (in my CVS version it is lines 1180 to 1187); """ def _setIcon( self, aResource ) : """Set icon based on resource values""" if ('icon' in aResource.__dict__) and (aResource.icon is not None): try: icon = wx.wxIcon(aResource.icon, wx.wxBITMAP_TYPE_ICO) self.SetIcon(icon) except: pass """ The line of interest to you is probably the one where we build the icon object by calling wx.wxIcon(). The type specified there is wx.wxBITMAP_TYPE_ICO, which if you look at the wxWindows docs is specified as a "Windows Icon file". And that's where my knowledge trickles out I'm afraid. You may get a bit more insight looking at the wxWindows documentation for this class; http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin_wxicon.html#wxicon Although I suspect that nothing will get changed for 0.7 it may be possible to add an optional type to the icon definition in the resource file format for 0.8. That way you could supply and specify a different type of icon file. Before this is going to happen though someone needs to investigate the handling of icons and suggest (even better, code) a sensible implementation. Regards, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ |