Not directly without quit a bit of work, but you can you do it by using _custom_classes, I use this for all kind of controls I customize in some way. For the OLV and DVC which I currently do some testing on I create Boa:FramePanel on which I manually code the ObjectListView, DataViewControl or similar and then add it to the frame by definining it like this:
sounds a bit too advanced for me at this time. but thank you for the info Werner.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-08-17
I have a similar situation where I am trying to add an ObjectListView to Boa Constructor via the Frame Designer. I finally figured out how to add OLV to my Python library (which was an effort in itself, as I am new to Python and its permutations…)
Anyway, I think I've followed the code design from Werner (above), but I keep getting errors. Here is the wx.Panel control (basic for now, I just want to get the basics working first):
Traceback (most recent call last):
File "C:/Python27/boa-constructor-0.6.1/Program Files/PyK2/PyK2.py", line 22, in <module>
main()
File "C:/Python27/boa-constructor-0.6.1/Program Files/PyK2/PyK2.py", line 18, in main
application = BoaApp(0)
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 7981, in __init__
self._BootstrapApp()
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 7555, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "C:/Python27/boa-constructor-0.6.1/Program Files/PyK2/PyK2.py", line 12, in OnInit
self.main = PyK2Main.create(None)
File "C:/Python27/boa-constructor-0.6.1/Program Files/PyK2\PyK2Main.py", line 6, in create
return PyK2Main(parent)
File "C:/Python27/boa-constructor-0.6.1/Program Files/PyK2\PyK2Main.py", line 28, in __init__
self._init_ctrls(parent)
File "C:/Python27/boa-constructor-0.6.1/Program Files/PyK2\PyK2Main.py", line 22, in _init_ctrls
self.PlaylistPanel = OLVPanel(id=wxID_PYK2MAINPLAYLISTPANEL,
NameError: global name 'OLVPanel' is not defined
>>>
Can anybody help me please? Thank you!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there a way for ObjectListView components to be availabel from the boa toolbar?
thank you,
bob k.
Hi Bob,
Not directly without quit a bit of work, but you can you do it by using _custom_classes, I use this for all kind of controls I customize in some way. For the OLV and DVC which I currently do some testing on I create Boa:FramePanel on which I manually code the ObjectListView, DataViewControl or similar and then add it to the frame by definining it like this:
class Frame1(wx.Frame):
_custom_classes = {'wx.ComboBox': ,
'wx.TextCtrl': ,
'wx.lib.masked.numctrl.NumCtrl': ,
'wx.Panel': ,}
….
self.theList = PanelDVC(id=wxID_FRAME1THELIST, name=u'theList',
parent=self.splitterWindow1, pos=wx.Point(0, 0), size=wx.Size(776,
197), style=wx.SUNKEN_BORDER | wx.TAB_TRAVERSAL)
You have to watch out that the custom classes behaves exactly the same as the base class in this case a wx.Panel.
Werner
sounds a bit too advanced for me at this time. but thank you for the info Werner.
I have a similar situation where I am trying to add an ObjectListView to Boa Constructor via the Frame Designer. I finally figured out how to add OLV to my Python library (which was an effort in itself, as I am new to Python and its permutations…)
Anyway, I think I've followed the code design from Werner (above), but I keep getting errors. Here is the wx.Panel control (basic for now, I just want to get the basics working first):
Here is the parent Frame (modified from the BC-generated code):
When I try to run it, I get this error:
Traceback (most recent call last):
File "C:/Python27/boa-constructor-0.6.1/Program Files/PyK2/PyK2.py", line 22, in <module>
main()
File "C:/Python27/boa-constructor-0.6.1/Program Files/PyK2/PyK2.py", line 18, in main
application = BoaApp(0)
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 7981, in __init__
self._BootstrapApp()
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 7555, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "C:/Python27/boa-constructor-0.6.1/Program Files/PyK2/PyK2.py", line 12, in OnInit
self.main = PyK2Main.create(None)
File "C:/Python27/boa-constructor-0.6.1/Program Files/PyK2\PyK2Main.py", line 6, in create
return PyK2Main(parent)
File "C:/Python27/boa-constructor-0.6.1/Program Files/PyK2\PyK2Main.py", line 28, in __init__
self._init_ctrls(parent)
File "C:/Python27/boa-constructor-0.6.1/Program Files/PyK2\PyK2Main.py", line 22, in _init_ctrls
self.PlaylistPanel = OLVPanel(id=wxID_PYK2MAINPLAYLISTPANEL,
NameError: global name 'OLVPanel' is not defined
>>>
Can anybody help me please? Thank you!