up with PyGUI!
Carlos Ribeiro
carribeiro at gmail.com
Sun Sep 26 00:40:04 EDT 2004
On 26 Sep 2004 04:15:57 GMT, Bengt Richter <bokr at oz.net> wrote:
> I could see a way to write this in terms of instances. Also playing a trick so that keyword
> arg CC=True would return a custom class instead of an instance, for repeated use of a
> particular customization:
>
> CustButtton = Button(CC=True, bgcolor='lightgreen', namefmt='cbtn%s', nextnameno=100)
> CustistBox = ListBox(CC=True, kind=ListBox.DROPDOWN, width=40, maxdrop=10) # default namefmt is cls.__name__+'%s'
>
> myFrame = (
> Frame(
> Sizer(
> CustButton(size= ... etc),
> CustButton(size= ... etc),
> Panel(
> Sizer(
> CustListBox(etc),
> CustListBox(etc),
> CustButton(etc),
> Text( etc )
> )
> )
> )
> )
> )
>
It may sound like a silly excuse, but this sequence of closing
parenthesis is as unpythonic as it could be :-) In practice, it does
keep some of the proposed advantages of our little class creation
system. In theory, it's still different, because it's imperative, not
declarative. Is it a big difference? Maybe it doesn't sum up to
anything that big. I really don't know -- I'm still inclined to work
with the class declaration as a better, more concise and consistent
way to do what I want. But I concede that I'm lacking good arguments
-- it's more a 'hunch' than something that I can really argue about.
For now, it's more about "trust me, it will work" than anything
else...
--
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com
More information about the Python-list
mailing list