I'm new to Python and wxPython but I've to modify an (small)
application wich use XRC.
I want to use a ComboTreeBox or a ComboCtrl + TreeCtrl (like in the
wxPython demo), but I don't find how to do this with XRC.
Is there someone who can help me ?
Thanks,
--
Fred
Welcome to the wonderful world of Python and friends. If those
controls are not in XRCed, then you'll have to create them yourself.
Fortunately, this tutorial gives you some hints on the subject:
I'm new to Python and wxPython but I've to modify an (small)
application wich use XRC.
I want to use a ComboTreeBox or a ComboCtrl + TreeCtrl (like in the
wxPython demo), but I don't find how to do this with XRC.
One way is to use XRC's UnknowControl capability to do this. It essentially creates a placeholder in the XRC and then later from the Python code you create the ComboTreeBox and attach it to that placeholder.
Another possibility is to create a XmlResourceHandler class that will enable XRC to know how to make the ComboTreeBox like any other widget type.
It won't be easy (I'm new in Python & wxPython), but I'll try to
follow this tutorial.
···
On Jun 15, 5:20 pm, Mike Driscoll <kyoso...@gmail.com> wrote:
Hi Fred,
On Jun 15, 2:40 am, Fred <fper...@worldonline.fr> wrote:
> Hello,
> I'm new to Python and wxPython but I've to modify an (small)
> application wich use XRC.
> I want to use a ComboTreeBox or a ComboCtrl + TreeCtrl (like in the
> wxPython demo), but I don't find how to do this with XRC.
> Is there someone who can help me ?
> Thanks,
> --
> Fred
Welcome to the wonderful world of Python and friends. If those
controls are not in XRCed, then you'll have to create them yourself.
Fortunately, this tutorial gives you some hints on the subject:
It's a bit too complicated for me
An example will be very appreciate...
Is it the same as in the tutorial given by Mike Driscoll ?
Thank you.
(sorry for my bad english)
···
On Jun 15, 7:47 pm, Robin Dunn <ro...@alldunn.com> wrote:
Fred wrote:
> Hello,
> I'm new to Python and wxPython but I've to modify an (small)
> application wich use XRC.
> I want to use a ComboTreeBox or a ComboCtrl + TreeCtrl (like in the
> wxPython demo), but I don't find how to do this with XRC.
One way is to use XRC's UnknowControl capability to do this. It
essentially creates a placeholder in the XRC and then later from the
Python code you create the ComboTreeBox and attach it to that placeholder.
Another possibility is to create a XmlResourceHandler class that will
enable XRC to know how to make the ComboTreeBox like any other widget type.
--
Robin Dunn
Software Craftsmanhttp://wxPython.org
It's a bit too complicated for me
An example will be very appreciate...
There is an example of an XmlResourceHandler in the main demo.
For the unknown control approach you simply create a placeholder object in your XRC that has a class of "unknown". Be sure to set a name and any other properties that are appropriate. When the XRC is loaded then an empty panel will be created at that posiiton in the UI. You can then call the XmlResource's AttachUnknownControl method passing the XRC name of the unknown item and the widget to be placed at that position in the layout.