# Sizable changes in SVN

**URL:** <https://www.ruby-forum.com/t/sizable-changes-in-svn/211733>\
**Category:** Ruby-Gnome 2\
**Created:** [September 12, 2011, 5:15pm UTC](https://www.ruby-forum.com/t/sizable-changes-in-svn/211733 "2011-09-12T17:15:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [September 12, 2011, 5:15pm UTC](https://www.ruby-forum.com/t/sizable-changes-in-svn/211733/1 "2011-09-12T17:15:39Z")

</div>

Hi!

I pushed some rather sizable changes to SVN, primarily in gtk2. I  
removed all methods that implement methods already implemented as  
properties. I also removed unnecessary/superfluous/frivolous calls to  
G\_DEF\_SETTERS(), as G\_DEF\_SETTERS() isn’t exactly fast.

I noticed something while doing this, however. If HAVE\_NODE\_ATTRASGN  
is set, rbgobj\_define\_property\_accessors uses alias for properties, so  
all rb\_undef\_method() in gtk2 for methods that redefine properties may  
need rb\_undef\_method() for the #attribute= method as well (followed by  
a matching G\_DEF\_SETTER()). HAVE\_NODE\_ATTRASGN only seems to be set  
for Ruby 1.7, however, so this shouldn’t really be a problem.

---

<div class="post-metadata">

**Author:** ![Nikolai\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df705f/32.png) [@Nikolai\_W](https://www.ruby-forum.com/u/Nikolai_W)\
**Post date:** [September 15, 2011, 3:32pm UTC](https://www.ruby-forum.com/t/sizable-changes-in-svn/211733/2 "2011-09-15T15:32:33Z")

</div>

On Mon, Sep 12, 2011 at 17:15, Nikolai W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I noticed something while doing this, however. If HAVE\_NODE\_ATTRASGN  
> is set, rbgobj\_define\_property\_accessors uses alias for properties, so  
> all rb\_undef\_method() in gtk2 for methods that redefine properties may  
> need rb\_undef\_method() for the #attribute= method as well (followed by  
> a matching G\_DEF\_SETTER()). HAVE\_NODE\_ATTRASGN only seems to be set  
> for Ruby 1.7, however, so this shouldn’t really be a problem.

As I suspected, this is causing problems. I don’t understand how this  
has worked in the past, but I’m adding a new pair of macros  
G\_REPLACE\_PROPERTY() and G\_REPLACE\_PROPERTY\_AND\_SETTER() that we can  
use:

#define G\_REPLACE\_PROPERTY(klass, name, function, args)   
rb\_undef\_method(klass, “set\_” name);   
rb\_define\_method(klass, “set\_” name, function, args)

#define G\_REPLACE\_PROPERTY\_AND\_SETTER(klass, name, function, args)   
G\_REPLACE\_PROPERTY(klass, name, function, args);   
rb\_undef\_method(klass, name “=”);   
G\_DEF\_SETTER(klass, name)

I will apply this patch later today once I get everything in place.
