On Jun 3, 2007, at 11:10 AM, Tal Einat wrote:
>> fnt = obj.Font
>> fnt.Size = 16
>> obj.Font = fnt
>>
>> -or-
>>
>> obj.FontSize = 16
>
> Why not:
> obj.Font.Size = 16
That would work, too.
> Still, having -too many- "magic" properties can be confusing. I
> would prefer
> getting to anything font-related through a Font property than
> directly, even if
> the functionality is the same. But, that's just me, and this is
> mostly a style
> issue. Still, since TIOOWTDI is considered Pythonic, this does seem
> somewhat
> un-Pythonic...
The quote from the Zen of Python is:
There should be one-- and preferably only one --obvious way to do it.
Since you were only aware of one way to do it, it could be said that
there *is* only one obvious way; the other ways are more obscure.
I understand that to you, label.Font.Size is more natural, but I
don't think that that's generally the case. To many, the label *is*
the text, and should be able to be manipulated directly. Also, what
about the color of the label? Is that a property of the Font, or of
the label itself? Should you be able to specify
label.Font.Color="red" and get red text? You could argue it both
ways, and I've seen both ways implemented. wxPython doesn't think so,
but the native OS X font dialog allows you to specify the color of a
selected font. What about label.Font.Visible = False? Should that
make the text disappear, but the background remain?
The point I'm making is that there are all sorts of trade-offs, and
we went with a design that we felt was the most consistent. Being
able to directly modify properties of any control is the choice that
we've made, and so far it's proven to be a sound choice.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]