# Question about properties

**URL:** <https://www.ruby-forum.com/t/question-about-properties/96586>\
**Category:** Ruby-Gnome 2\
**Created:** [June 30, 2006, 12:10am UTC](https://www.ruby-forum.com/t/question-about-properties/96586 "2006-06-30T00:10:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laurent\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/67e7ee/32.png) [@Laurent\_J](https://www.ruby-forum.com/u/Laurent_J)\
**Post date:** [June 30, 2006, 12:10am UTC](https://www.ruby-forum.com/t/question-about-properties/96586/1 "2006-06-30T00:10:31Z")

</div>

I’m in the process of learning from the ruby-gnome2 source code and  
while reading the code I noticed that some function calls are commented  
and it says something like ‘XXXXX is a property’. An example of this is  
the VISIBLE attribute in gtk/rbwidget.c line 1053.

Could somebody tell me what this means exactly and where is the  
corresponsing C code to access XXXX actually defined?

Thanks for your help!

Laurent

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![Laurent\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/67e7ee/32.png) [@Laurent\_J](https://www.ruby-forum.com/u/Laurent_J)\
**Post date:** [July 3, 2006, 6:02pm UTC](https://www.ruby-forum.com/t/question-about-properties/96586/2 "2006-07-03T18:02:40Z")

</div>

Hi,

On Fri, 30 Jun 2006 00:07:19 +0200  
Laurent J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m in the process of learning from the ruby-gnome2 source code and  
> while reading the code I noticed that some function calls are commented  
> and it says something like ‘XXXXX is a property’. An example of this is  
> the VISIBLE attribute in gtk/rbwidget.c line 1053.
> 
> Could somebody tell me what this means exactly and where is the  
> corresponsing C code to access XXXX actually defined?

GLib properties are auto generated by Ruby/GLib on runtime.  
So you can access these properties like as Gtk::Widget#foo=,  
Gtk::Widget#foo  
unless no C codes.

See rbgobj\_define\_property\_accessors() in glib/src/rbgobject.c.

–  
.:% Masao M.[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![Laurent\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/67e7ee/32.png) [@Laurent\_J](https://www.ruby-forum.com/u/Laurent_J)\
**Post date:** [July 5, 2006, 9:21am UTC](https://www.ruby-forum.com/t/question-about-properties/96586/3 "2006-07-05T09:21:41Z")

</div>

Masao M. wrote:

> > Could somebody tell me what this means exactly and where is the  
> > corresponsing C code to access XXXX actually defined?
> 
> GLib properties are auto generated by Ruby/GLib on runtime.  
> So you can access these properties like as Gtk::Widget#foo=, Gtk::Widget#foo  
> unless no C codes.
> 
> See rbgobj\_define\_property\_accessors() in glib/src/rbgobject.c.

Ok I see. Is this done when calling G\_DEF\_CLASS in each Init\_xxxx  
function?

Thanks

Laurent

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![Laurent\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/67e7ee/32.png) [@Laurent\_J](https://www.ruby-forum.com/u/Laurent_J)\
**Post date:** [July 5, 2006, 5:56pm UTC](https://www.ruby-forum.com/t/question-about-properties/96586/4 "2006-07-05T17:56:24Z")

</div>

Hi,

On Wed, 05 Jul 2006 09:20:25 +0200  
Laurent J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > >
> 
> Ok I see. Is this done when calling G\_DEF\_CLASS in each Init\_xxxx function?

No. G\_DEF\_CLASS has another role.

It’s better to read these article first below.

[http://ruby-gnome2.sourceforge.jp/hiki.cgi?Naming+and+Conversion+Rules](http://ruby-gnome2.sourceforge.jp/hiki.cgi?Naming+and+Conversion+Rules)  
[http://ruby-gnome2.sourceforge.jp/hiki.cgi?How+to+Implement+Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/hiki.cgi?How+to+Implement+Ruby-GNOME2)

HTH,

–  
.:% Masao M.[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)
