how to extend an instance of visual class: was using RADs in OO way

Serge Boiko boiko at demogr.mpg.de
Fri May 23 16:44:38 EDT 2003


On Fri, 23 May 2003 11:50:49 +0200, Alex Martelli wrote:

Thank you, Alex, you gave me a nice portion of intellectual food :-)

> 
> I'm not quite sure which settings are "relevant" to you here, i.e.
> which ones you want to pick up from the 'other button' -- as you
> appear to want to override the text, it seems that only the geometry
> (layout) might perhaps be relevant.  But anyway, more generally, your
> code clear DOES have to know what to pick up from the other widget
> you're replacing and what to override, so you might as well code that
> knowledge into appropriate 'clonestate' methods of your specialized
> widgets (optionally and appropriately called from their __init__).
> 
It was only a simple example to demonstrate the problem. Actually
I'm *really* interested in the layout settings rather than in something
else. My idea is to use the "visual proxy pattern" proposed by
Allen Holub.

> There are of course many other approaches, such as ensuring that your
> specialized widgets get onto the widget palette available to the GUI
> builder tool so that the form designer can choose them if desired;-).

Absolutely, but for the specific case of visual proxy architecture
it doesn't seem to be the best way. Perhaps, it's a matter of my
personal habits: I love to write code in emacs and use RAD only to
design layouts. That is why it's important to me to separate my code
from the code generated by the RAD.

Many thanks.
-Serge






More information about the Python-list mailing list