On Tue, 2005-09-13 at 00:08 -0400, Chris Hoefler wrote:
> Hi,
>
> I have a bit of gtk experience, but I am still fairly new to
> python/pygtk and I don't quite understand how GObject properties work.
> I've been digging through all of the documentation/examples I can find.
> As far as I can tel
Hi,
I have a bit of gtk experience, but I am still fairly new to
python/pygtk and I don't quite understand how GObject properties work.
I've been digging through all of the documentation/examples I can find.
As far as I can tell there have been some changes to how custom
properties of subclas
Lorenzo Gil Sanchez schrieb:
Sorry, but I can't find the o.get_name and o.set_name methods in the
gtklabel.c file (or any other file). Could you please put an example or
give me some more detailed pointer?
These methods were meant as an abstract example for a property called
'name' (take GtkWidget
El mar, 05-08-2003 a las 03:34, Jan Weil escribió:
> To actually set or get a property a Python GObject calls the class methods
> 'do_set_property' and 'do_get_property'. These methods are virtual which
> means you'll have to implement them.
> Typically most of the properties can also be controll
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
Jan Weil schrieb:
But could someone please enlighten me, why am I supposed to implement
'do_set_property' and 'do_get_property'?
Once again the source was with me.
I collected my experiences as a newbie to Glib's type and object system
approaching it from the Python site.
For me there were some p
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
On Tue, Aug 05, 2003 at 03:34:55AM +0200, Jan Weil wrote:
>
> Once again the source was with me.
> I collected my experiences as a newbie to Glib's type and object system
> approaching it from the Python site.
> For me there were some pitfalls and therefore I want to share this with
> the list.
Jan Weil schrieb:
If I create a subclass of gobject.GObject in Python, can I somehow
install my own set of properties?
Sorry for constantly decreasing the SNR of this list.
The source is with me and I eventually found the example for gobject
properties.
I'm even learning how to search a mailing l
If I understand this correctly, every GObject (class) has a set of
properties and whenever one of these properties is changed a 'notify'
signal is emitted.
So that in terms of MVC a view can connect to its model's 'notify' signal.
Is that right so far?
If I create a subclass of gobject.GObject i
23 matches
Mail list logo