Hello list,
I was looking at returning dictionary of control values from panels
built with xrced and came-up with a xrcMixin class which adds the
GetValues() method.
I then noticed that I could change the behaviour of the panel elements
on the fly and wrote a really basic debug function to prove the point:
In debug mode, a tooltip with the element name is appended to each and
every element of the panel. The debug code will also warn me if
multiple elements have the same name. Since the returned dictionary
uses the element names as keys, unique names are essential.
I kind of ran out of ideas at this stage... but the 10 lines of code
it took, can easily be extended I'm sure
In any case, I wrote a small wiki:
http://code.google.com/p/ezwidgets/wiki/XrcMixin which explains the
code in more details and provides a working example.
The code will be useful (I hope) for panels with lots of controls,
which I can now query using a single function.
Comments welcome!
Regards,
Egor
Hello list,
just a quick follow-up on my post.
I've rewritten the UsingXmlResources - wxPyWiki calc
example using my xrc mixin, which hides away a lot of the control /
parent panel glue that was required before. I'm hoping to get to the
stage where importing xrc is no longer needed and all the event
binding / control binding is done either automatically in the code
generated by xrced or by xrc mixins.
Anyway, tutorial here:
http://code.google.com/p/ezwidgets/wiki/XrcCalc
and the original page (with an update to show how to call the wxPython
inspection tool in debug mode):
http://code.google.com/p/ezwidgets/wiki/XrcMixin
Regards,
Egor
ยทยทยท
On Dec 15, 10:10 pm, Egor Zindy <ezi...@gmail.com> wrote:
Hello list,
I was looking at returning dictionary of control values from panels
built with xrced and came-up with a xrcMixin class which adds the
GetValues() method.
I then noticed that I could change the behaviour of the panel elements
on the fly and wrote a really basic debug function to prove the point:
In debug mode, a tooltip with the element name is appended to each and
every element of the panel. The debug code will also warn me if
multiple elements have the same name. Since the returned dictionary
uses the element names as keys, unique names are essential.
I kind of ran out of ideas at this stage... but the 10 lines of code
it took, can easily be extended I'm sure
In any case, I wrote a small wiki:Google Code Archive - Long-term storage for Google Code Project Hosting. explains the
code in more details and provides a working example.
The code will be useful (I hope) for panels with lots of controls,
which I can now query using a single function.
Comments welcome!
Regards,
Egor