Jan Weil schrieb:
I don't like this idea either.
Especially because it's quite easy to emulate this behaviour in Python
(see example attached).
That's obviously not an option if you had to wrap every gtk widget by hand.
This one wouldn't let me sleep. But it's really fun (see example attached).
G
Iñaki García Etxebarria schrieb:
But IMO the main question is whether it is really advantageously to map
the properties to attributes.
I think so, it produces readable code, and many times is very natural.
And, to me at least, the design of the properties api in gobject is
thought with this kind o
This may not be a democracy, but I would vote against this change.
Merging namespaces like this is asking for trouble. If it is done at
all, it should only be at the explicit request of the programmer (e.g.,
import gtk.__propertyHack__ as gtk).
On Fri, 2003-08-08 at 15:20, Iñaki García Etxebarri
Christian Reis kiko at async.com.br wrote:
Ah; Note that this is wrong here. You should not return None from
getattr, or all lookups on the object for non-existent attributes will
return None. This should be:
try:
return self.__dict__[key]
except KeyError:
raise AttributeErr
On Mon, Aug 11, 2003 at 01:11:01AM +0200, Jan Weil wrote:
> I am by no means an expert of OOP but what I read is that public data
> members in the long run tend to be unflexible.
> Thus you typically provide a pair of accessors like set_value, get_value
> (set_property/get_property).
Well, it co
On Sun, Aug 10, 2003 at 11:36:05AM +0200, Jan Weil wrote:
> Did you try this code?
Are you suggesting I don't test my code submissions? :o)
No; I don't have PyGTK2 available on my network.
> The problem is that if you assign to __properties in __init__,
> __setattr__ is called which calls __get
El vie, 08-08-2003 a las 15:07, Gustavo J. A. M. Carneiro escribió:
> > label = gtk.Label()
> > label.label = 'Hello World' # Changes the label in the gui
> > print label.label # prints 'Hello World'
>
> Perhaps it is wiser to add a small prefix to the python attribute, to
> avoid possible confl
> But IMO the main question is whether it is really advantageously to map
> the properties to attributes.
I think so, it produces readable code, and many times is very natural.
And, to me at least, the design of the properties api in gobject is
thought with this kind of purposes in mind.
> What a
On Sun, Aug 10, 2003 at 03:55:56AM +0200, Jan Weil wrote:
> Good night,
>
> class MyObject:
> def __init__(self):
> if issubclass(self.__class__, gobject.GObject):
> self.properties = []
> for param in gobject.list_properties(self):
> self.proper
I don't like this idea either.
Especially because it's quite easy to emulate this behaviour in Python
(see example attached).
Jan
Jon Willeke schrieb:
This may not be a democracy, but I would vote against this change.
Merging namespaces like this is asking for trouble. If it is done at
all, it
Hi,
El dom, 10-08-2003 a las 01:04, Jan Weil escribió:
> I don't like this idea either.
> Especially because it's quite easy to emulate this behaviour in Python
> (see example attached).
Well, as long as I can write the Python code as I want, I don't care
much about the underlying implementation
Did you try this code?
I get (and this is what I expected):
[...]
File "./mygtk.py", line 21, in __getattr__
if self.__properties and key in self.__properties:
File "./mygtk.py", line 21, in __getattr__
if self.__properties and key in self.__properties:
File "./mygtk.py", line 21, i
A Qui, 2003-08-07 às 19:22, Iñaki García Etxebarria escreveu:
> Howdy everyone,
>
> Attached goes a patch against pygtk 1.99.17 that lets you do things like
> ---
> label = gtk.Label()
> label.label = 'Hello World' # Changes the label in the gui
> print label.label # prints 'Hello World'
Perhap
Howdy everyone,
Attached goes a patch against pygtk 1.99.17 that lets you do things like
---
label = gtk.Label()
label.label = 'Hello World' # Changes the label in the gui
print label.label # prints 'Hello World'
---
for any gobject. I.e., setting gobject properties as if they were
regular attribu
On Thu, Aug 07, 2003 at 08:22:06PM +0200, Iñaki García Etxebarria wrote:
> Howdy everyone,
>
> Attached goes a patch against pygtk 1.99.17 that lets you do things like
> ---
> label = gtk.Label()
> label.label = 'Hello World' # Changes the label in the gui
> print label.label # prints 'Hello World
15 matches
Mail list logo