Extra code / Extra properties

Dietmar Schwertberger <[email protected]>
Newsgroups gmane.comp.python.wxglade
Message-ID <[email protected]>
Hi!

Is anyone actually using "Extra properties for this widget"?

I was just about to prepare a code example for how to use the 
CustomWidget for adding classes that are not supported natively by wxGlade.

My example would be a matplotlib canvas. This requires some imports and 
a bit of code before and after creation, as it requires an object to be 
created and supplied as argument. The workaround would be to derive a 
class and use this instead of the original matplotlib canvas. That's 
possible, but not too nice.

I'm completely missing a way to specify the code to be executed before 
creation of an object.

Also, for the code after creation, there's only the method to specify 
extra properties.
E.g. property "maxLength" and value "10".
This is then magically converted to self.my_custom_widget.SetMaxLength(10).

Personally, I would prefer to have three fields:
  * Extra import code (added on module level, just as now).
  * Extra setup code (to be called right before the widget is instantiated)
  * Extra code (to be called right after the widget is instantiated)

With this setup, I'm wondering whether the Extra properties make sense 
any more.

What do you think? Do you have real-world examples? Do you have any 
preferences in favour or against such a change?

In theory the Extra properties have the advantage that they are 
language-neutral, but I have some doubts whether this has practical 
relevance.


Regards,

Dietmar



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
wxGlade-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxglade-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.