Sign up

Getting property names from ObjectG

I am trying to extract a list of properties from a gtk.TextTag. I know what properties can be there, because they are listed in the GTK documentation, but I'd prefer to not query all of them just to find out if they are there. Or maybe they are all there in every TextTag, just not used, as per the hint given by the existence of propname-set properties?

TextTag is derived from ObjectG, which defines the method for getting properties. Is there any way I can get the list of property names from an ObjectG instance?

classListProperties looks promising, but TextTag does not appear to be an instance of GObjectClass.

Thanks
Steve

Re: Getting property names from ObjectG

On 11/18/2013 05:52 AM, Steve Teale wrote:

I am trying to extract a list of properties from a gtk.TextTag. I know what properties can be there, because they are listed in the GTK documentation, but I'd prefer to not query all of them just to find out if they are there. Or maybe they are all there in every TextTag, just not used, as per the hint given by the existence of propname-set properties?

TextTag is derived from ObjectG, which defines the method for getting properties. Is there any way I can get the list of property names from an ObjectG instance?

classListProperties looks promising, but TextTag does not appear to be an instance of GObjectClass.

Thanks
Steve

The GObjectClass or the derived variants like GtkTextTagClass are part
of GObjects implementation of a virtual function table. And everything
derived from GObject has one.

classListProperties(getInstanceClass!GObjectClass(textTag));

getInstanceClass is in gobject.Type.

As far as i know this will return all the documented properties since
they always have an default value.

Re: Getting property names from ObjectG

classListProperties looks promising, but TextTag does not appear to be an instance of GObjectClass.

Thanks
Steve

The GObjectClass or the derived variants like GtkTextTagClass are part
of GObjects implementation of a virtual function table. And everything
derived from GObject has one.

classListProperties(getInstanceClass!GObjectClass(textTag));

getInstanceClass is in gobject.Type.

As far as i know this will return all the documented properties since
they always have an default value.

Well Mike, I'd never have found that in the documentation! But from what you're saying, it sounds like that will give me a list of properties that the class can have, right? What I was looking for was a list of the properties it actually has at some point in time.

I guess I am already doing the right thing, trying to get properties that the documentation says are there, and skipping on happily if they're not. Ah well.

I'll try it anyway. Thanks for your time.

Getting started with Gtkd coming along - 8 articles posted - britseyeview.com/software/articles/gsgtkd101.html and subsequent. I am learning a lot quite quickly!

Re: Getting property names from ObjectG

On 11/19/2013 06:56 PM, Steve Teale wrote:

Well Mike, I'd never have found that in the documentation! But from what you're saying, it sounds like that will give me a list of properties that the class can have, right? What I was looking for was a list of the properties it actually has at some point in time.

It will always give you all of them.

I guess I am already doing the right thing, trying to get properties that the documentation says are there, and skipping on happily if they're not. Ah well.

I'll try it anyway. Thanks for your time.

Getting started with Gtkd coming along - 8 articles posted - britseyeview.com/software/articles/gsgtkd101.html and subsequent. I am learning a lot quite quickly!

Looking good. There is an broken image on 108 tough.