|
List Info
Thread: 20061006 test build uploaded
|
|
| 20061006 test build uploaded |

|
2006-10-11 23:31:00 |
Nikalren wrote:
> I was testing some of my code with the new 2.7 version
and I came across
> this problem: wx.Image.Size, which resizes an image,
conflicts with the
> new getter/setter properties -- now it's just a
property for image size.
> Resize and Size do the same thing, though, so you can
just use Resize
> instead.
Actually they are different. Size returns a new image that
is the
specified size, without modifying the original, and Resize
modifies the
original. So I'll need to remove that property.
> Interestingly, I don't see GetSize/SetSize in the
wxWidgets
> docs for wxImage, only GetWidth/SetWidth and
GetHeight/SetHeight,
> although GetSize and SetSize are in wxPython 2.6.3
also.
They are Python specific additions.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java
give you jitters? Relax with wxPython!
------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-dev-unsubscribe lists.wxwidgets.org
For additional commands, e-mail: wxPython-dev-help lists.wxwidgets.org
|
|
| 20061006 test build uploaded |

|
2006-10-11 23:55:19 |
Robin Dunn wrote:
> Actually they are different. Size returns a new image
that is the
> specified size, without modifying the original, and
Resize modifies the
> original. So I'll need to remove that property.
Boy, that's a bad name -- could we just change it to AsSize
or NewSize,
or something so that we can have that nice Size property be
what we'd
expect?
This does make me wonder about the property idea -- I really
like
getting rid of all those getters and setters, but given the
the C++ API
is designed with them, things like this are likely to crop
up a lot.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker noaa.gov
------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-dev-unsubscribe lists.wxwidgets.org
For additional commands, e-mail: wxPython-dev-help lists.wxwidgets.org
|
|
| 20061006 test build uploaded |

|
2006-10-12 00:06:06 |
On 10/12/06, Christopher Barker <Chris.Barker noaa.gov> wrote:
> Robin Dunn wrote:
> > Actually they are different. Size returns a new
image that is the
> > specified size, without modifying the original,
and Resize modifies the
> > original. So I'll need to remove that property.
>
> Boy, that's a bad name -- could we just change it to
AsSize or NewSize,
> or something so that we can have that nice Size
property be what we'd
> expect?
>
> This does make me wonder about the property idea -- I
really like
> getting rid of all those getters and setters, but given
the the C++ API
> is designed with them, things like this are likely to
crop up a lot.
This may have been discussed and rejected already, but why
not jsut
make the properties start with a lower case letter?
Then the conflicts would be eliminated, and besides,
Image.size looks
much more like a property value to me than Image.Size.
--bb
------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-dev-unsubscribe lists.wxwidgets.org
For additional commands, e-mail: wxPython-dev-help lists.wxwidgets.org
|
|
| 20061006 test build uploaded |

|
2006-10-12 00:15:16 |
Christopher Barker wrote:
> Robin Dunn wrote:
>> Actually they are different. Size returns a new
image that is the
>> specified size, without modifying the original, and
Resize modifies
>> the original. So I'll need to remove that
property.
>
> Boy, that's a bad name
Agreed.
> -- could we just change it to AsSize or NewSize,
> or something so that we can have that nice Size
property be what we'd
> expect?
The only problem with that is that existing code that is
already using
the Size method will break.
>
> This does make me wonder about the property idea -- I
really like
> getting rid of all those getters and setters, but given
the the C++ API
> is designed with them, things like this are likely to
crop up a lot.
It's happened a lot less times than I expected,
surprisingly.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java
give you jitters? Relax with wxPython!
------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-dev-unsubscribe lists.wxwidgets.org
For additional commands, e-mail: wxPython-dev-help lists.wxwidgets.org
|
|
| 20061006 test build uploaded |

|
2006-10-12 00:23:28 |
Bill Baxter wrote:
> On 10/12/06, Christopher Barker <Chris.Barker noaa.gov> wrote:
>> Robin Dunn wrote:
>> > Actually they are different. Size returns a
new image that is the
>> > specified size, without modifying the
original, and Resize modifies the
>> > original. So I'll need to remove that
property.
>>
>> Boy, that's a bad name -- could we just change it
to AsSize or NewSize,
>> or something so that we can have that nice Size
property be what we'd
>> expect?
>>
>> This does make me wonder about the property idea --
I really like
>> getting rid of all those getters and setters, but
given the the C++ API
>> is designed with them, things like this are likely
to crop up a lot.
>
> This may have been discussed and rejected already, but
why not jsut
> make the properties start with a lower case letter?
When you take into account the existing user code I think
that there
would be more conflicts, not less. The rational for using
upper case is
that programmers are more likely to use lower case in their
own code for
attribute names in derived classes, and so if somebody is
already using
self.size in their code then it wouldn't conflict with the
Size
property. Along those same lines, there is already a common
practice of
programmers knowing that anything that starts with an upper
case letter
is a "wx thing" and if it starts with a lower case
then it is "my thing"
(other than class names I guess.)
BTW, way back before Python got property support I
experimented with
using pseudo properties by giving the classes __getattr__
and
__setattr__ methods, and I used lower case names then.
There were lots
of conflicts then that broke peoples existing programs. It
probably
wouldn't be so bad now since the properties would just be
hidden by the
programmer's attributes instead of the other way around with
__getattr__
and __setattr__, but still...
--
Robin Dunn
Software Craftsman
http://wxPython.org Java
give you jitters? Relax with wxPython!
------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-dev-unsubscribe lists.wxwidgets.org
For additional commands, e-mail: wxPython-dev-help lists.wxwidgets.org
|
|
[1-5]
|
|