Re: Designing objects with GObject

2007-06-29 Thread Tomasz Jankowski


 You will use g_object_class_override_property() anyway.
 Doesn't it allow to make a READABLE proeprty READWRITE?


No, this function doesn't allow to change property behavior. It only
implements property defined in interface. Any other idea please? ;)

-- 
Cya!
Tom
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Designing objects with GObject

2007-06-29 Thread Konstantin Evdokimenko
If you will make properties of interface C writable and readable in object A and
only readable in object B then objects A and B will not implement the
same interface.

Try ignore writing these properties for object B. But I don't know how
this may be done =(.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Designing objects with GObject

2007-06-29 Thread Yeti
On Fri, Jun 29, 2007 at 06:39:47PM +0800, Konstantin Evdokimenko wrote:
 If you will make properties of interface C writable and readable in object A 
 and
 only readable in object B then objects A and B will not implement the
 same interface.

The common interface is the read-only property here,
A implements an extension: read-write.

 Try ignore writing these properties for object B. But I don't know how
 this may be done =(.

You can do this, as you control set_property().  The problem
is that this is a hack invisible to inspection, therefore it
can lead to all sorts of odd behaviour.

Yeti

--
http://gwyddion.net/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Designing objects with GObject

2007-06-29 Thread Tomasz Jankowski
 You can do this, as you control set_property().  The problem
 is that this is a hack invisible to inspection, therefore it
 can lead to all sorts of odd behaviour.


So it's exactly as I thought. I'll implement those properties separately for
both objects. I don't want to make any surprises to my code.


-- 
Cya!
Tom
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Designing objects with GObject

2007-06-29 Thread Tristan Van Berkom
On Fri, 2007-06-29 at 13:40 +0200, Tomasz Jankowski wrote:
  You can do this, as you control set_property().  The problem
  is that this is a hack invisible to inspection, therefore it
  can lead to all sorts of odd behaviour.
 
 
 So it's exactly as I thought. I'll implement those properties separately for
 both objects. I don't want to make any surprises to my code.
 

I remember being told this in #gtk+ irc in the last month;
If you want to override the default value or read/write flags
on a property you can simply re-install it in the subclass.

Basically, your implementing class can g_object_class_install_property
and if its the same name it will replace whatever properties were
installed by parent classes or interfaces.

Cheers,
-Tristan


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Designing objects with GObject

2007-06-29 Thread Yeti
On Fri, Jun 29, 2007 at 12:25:38PM -0400, Tristan Van Berkom wrote:
 If you want to override the default value or read/write flags
 on a property you can simply re-install it in the subclass.
 
 Basically, your implementing class can g_object_class_install_property
 and if its the same name it will replace whatever properties were
 installed by parent classes or interfaces.

Why this isn't written anywhere... sigh

Yeti

--
http://gwyddion.net/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Designing objects with GObject

2007-06-28 Thread Yeti
On Thu, Jun 28, 2007 at 01:54:29PM +0200, Tomasz Jankowski wrote:
 I have such situation. I have two objects A and B and interface C, which
 should be implemented by both of them. The problem is that some of
 properties of interface C should be writable and readable in object A and
 only readable in object B. Is there any way to keep them in interface C and
 don't do any ugly tricks to go around GObject rules? I really don't want to
 implement separately for both objects.

You will use g_object_class_override_property() anyway.
Doesn't it allow to make a READABLE proeprty READWRITE?

Yeti

--
http://gwyddion.net/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list