Hi, I have one question.
I made Executable by using py2exe.
but, It display error message such as "Subclass 'FINM.MyFrame' not
found for resource 'MainFrame', not subclassing!."
It works fine before making exe.
I have not been able to make it work.
code here:
# -*- coding: utf-8 -*-
xrc_str = """<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
<object class="wxFrame" name="MainFrame" subclass="FINM.MyFrame">
<style>wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL</style>
<title></title>
</object>
</resource>"""
import wx
from wx import xrc
···
#===============================================================================
# Global
#===============================================================================
_firstEventType = wx.EVT_WINDOW_CREATE
#===============================================================================
# MyFrame
#===============================================================================
class MyFrame( wx.Frame ):
def __init__( self ): #IGNORE:W0231
pre = wx.PreFrame()
self.PostCreate( pre )
self.Bind( _firstEventType , self.OnCreate )
def OnCreate( self , event ):#IGNORE:W0613
self.Unbind( _firstEventType )
#===============================================================================
# FINM
#===============================================================================
class FINM( wx.App ):
def __init__( self ):
wx.App.__init__( self , False )
def OnInit( self ):
xmlRes = xrc.EmptyXmlResource()
xmlRes.LoadFromString( xrc_str )
assert( xmlRes )
self.frame = xmlRes.LoadFrame( None , 'MainFrame' )
#IGNORE:W0201
assert( self.frame )
self.frame.SetSize( ( 1024, 768 ) )
self.frame.Center()
self.frame.Show()
return True
def main():
app = FINM()
app.MainLoop()
if __name__ == '__main__':
main()
P.S
Sorry about my poor english