I have implemented the following simple python script by means of the BOA Constructor 0.6.1:
This script creates a root item in a wxTreeCtrl with an Icon. If I start the script then it is working.
I am using:
- Windows XP
- python 2.7
- wxpython 2.9.4
- py2exe 0.6.9
If I generate an exe file from my python script by means of py2exe (without any error) then I cannot see the Icon before the root item.
I used the following setup.py python script:
from distutils.core import setup
import py2exe
If I use python 2.5 with wxpython 2.8 for the same thing then the exe is working as well and I can see the Icon before the root item.
What shall I do to be able to see the icon before the root item during the exe file execution under python 2.7, wxpython 2.9.4???
Thanks in advance
Code:
#Boa:Frame:Frame1
import wx
def create(parent):
return Frame1(parent)
[wxID_FRAME1, wxID_FRAME1TREECTRL1,
] = [wx.NewId() for _init_ctrls in range(2)]
[wxID_FRAME1TOOLBAR1TOOLS0] = [wx.NewId() for _init_coll_toolBar1_Tools in range(1)]
class Frame1(wx.Frame):
def _init_coll_imageList1_Images(self, parent):
# generated method, don't edit
parent.Add(bitmap=wx.Bitmap(u'D:/tmp/IconExe/treeCtrl/Icon.bmp',
wx.BITMAP_TYPE_BMP), mask=wx.NullBitmap)
def _init_utils(self):
# generated method, don't edit
self.imageList1 = wx.ImageList(height=16, width=16)
self._init_coll_imageList1_Images(self.imageList1)
def _init_ctrls(self, prnt):
# generated method, don't edit
wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt,
pos=wx.Point(642, 398), size=wx.Size(400, 250),
style=wx.DEFAULT_FRAME_STYLE, title='Frame1')
self._init_utils()
self.SetClientSize(wx.Size(392, 216))
self.treeCtrl1 = wx.TreeCtrl(id=wxID_FRAME1TREECTRL1, name='treeCtrl1',
parent=self, pos=wx.Point(0, 0), size=wx.Size(392, 216),
style=wx.TR_HAS_BUTTONS)
def __init__(self, parent):
self._init_ctrls(parent)
self.treeCtrl1.SetImageList(self.imageList1)
self.root = self.treeCtrl1.AddRoot("The Root Item")
self.treeCtrl1.SetPyData(self.root, None)
self.treeCtrl1.SetItemImage(self.root, 0, wx.TreeItemIcon_Normal)
self.treeCtrl1.SetItemImage(self.root, 0, wx.TreeItemIcon_Expanded)
if __name__ == '__main__':
app = wx.App()
frame = create(None)
frame.Show()
app.MainLoop()
This script creates a root item in a wxTreeCtrl with an Icon. If I start the script then it is working.
I am using:
- Windows XP
- python 2.7
- wxpython 2.9.4
- py2exe 0.6.9
If I generate an exe file from my python script by means of py2exe (without any error) then I cannot see the Icon before the root item.
I used the following setup.py python script:
from distutils.core import setup
import py2exe
Code:
setup(
options = {"py2exe": {"compressed": 1,
"optimize": 2,
"ascii": 1,
"bundle_files": 1,
},
},
zipfile = None,
windows = [
{
"script": "./../Frame1.py",
}
],
)
What shall I do to be able to see the icon before the root item during the exe file execution under python 2.7, wxpython 2.9.4???
Thanks in advance