# \[patch\] Use G\_CHILD\_ADD when adding elements and pads

**URL:** <https://www.ruby-forum.com/t/patch-use-g-child-add-when-adding-elements-and-pads/197169>\
**Category:** Ruby-Gnome 2\
**Created:** [March 29, 2008, 9:54pm UTC](https://www.ruby-forum.com/t/patch-use-g-child-add-when-adding-elements-and-pads/197169 "2008-03-29T21:54:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 29, 2008, 9:54pm UTC](https://www.ruby-forum.com/t/patch-use-g-child-add-when-adding-elements-and-pads/197169/1 "2008-03-29T21:54:14Z")

</div>

Hi,

See attached patch.

Sjoerd

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 29, 2008, 10:15pm UTC](https://www.ruby-forum.com/t/patch-use-g-child-add-when-adding-elements-and-pads/197169/2 "2008-03-29T22:15:29Z")

</div>

On Sat, Mar 29, 2008 at 09:53:48PM +0100, Sjoerd S. wrote:

> Hi,
> 
> See attached patch.

Which contained some typos, updated patch attached

Sjoerd

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 30, 2008, 1:04am UTC](https://www.ruby-forum.com/t/patch-use-g-child-add-when-adding-elements-and-pads/197169/3 "2008-03-30T01:04:42Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] [patch] Use G\_CHILD\_ADD when adding  
elements and pads” on Sat, 29 Mar 2008 22:14:51 +0100,  
Sjoerd S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > See attached patch.
> 
> Which contained some typos, updated patch attached

It was very happy for us if you considered to follow our  
coding-style.

> - if (!rb\_obj\_is\_kind\_of (element, klass)) {

Use RVAL2CBOOL not !.

Others are OK for me.

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 30, 2008, 1:30am UTC](https://www.ruby-forum.com/t/patch-use-g-child-add-when-adding-elements-and-pads/197169/4 "2008-03-30T01:30:31Z")

</div>

On Sun, Mar 30, 2008 at 09:04:23AM +0900, Kouhei S. wrote:

> It was very happy for us if you considered to follow our  
> coding-style.

You mentioned this on all my patches. But as i’m still unclear what the  
exact  
coding style is i’m guessing from various files and it seems i’m  
guessing wrong  
🙂 It would really help me if you could write some basic definition of  
your  
preferred coding style.

> > - if (!rb\_obj\_is\_kind\_of (element, klass)) {
> 
> Use RVAL2CBOOL not !.

Actually the ruby interpreter code itself uses !rb\_obj\_is\_kind\_of too,  
but i’ll  
change this 🙂

## Sjoerd

If I have not seen so far it is because I stood in giant’s footsteps.

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 30, 2008, 8:55am UTC](https://www.ruby-forum.com/t/patch-use-g-child-add-when-adding-elements-and-pads/197169/5 "2008-03-30T08:55:16Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] [patch] Use G\_CHILD\_ADD when adding  
elements and pads” on Sun, 30 Mar 2008 01:29:16 +0100,  
Sjoerd S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> You mentioned this on all my patches. But as i’m still unclear what the exact  
> coding style is i’m guessing from various files and it seems i’m guessing wrong  
> 🙂 It would really help me if you could write some basic definition of your  
> preferred coding style.

Does this mean “I can’t read source codes written by  
others”, “I don’t want to read source codes written by  
others carefully” or “I don’t want to follow your  
coding-style”? If this is true, unfortunately we will not be  
able to work on the same project.

You can read many source files in the Ruby-GNOME2 Project or  
ruby itself or use Emacs just for confirming coding-style.

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 30, 2008, 11:36am UTC](https://www.ruby-forum.com/t/patch-use-g-child-add-when-adding-elements-and-pads/197169/6 "2008-03-30T11:36:25Z")

</div>

On Sun, Mar 30, 2008 at 03:54:47PM +0900, Kouhei S. wrote:

> Does this mean “I can’t read source codes written by  
> others”, “I don’t want to read source codes written by  
> others carefully” or “I don’t want to follow your  
> coding-style”? If this is true, unfortunately we will not be  
> able to work on the same project.

It means none of the above. It means that as far as i can tell the patch  
i’ve  
attached in this thread follows the coding style which is in most other  
rubyg-gnome2 files (excluding ruby/gstreamer as that’s mostly a mess).  
But  
apparently i got some details wrong. So please instead of telling me  
that  
something is wrong, tell me what is wrong so i can fix it and improve it  
in the  
other patches too.

The bigger patches might have more obvious things wrong, i haven’t  
double-check  
them just yet. But i can’t find mistakes in the patch i attached in this  
thread.

## Sjoerd

FORTUNE’S FUN FACTS TO KNOW AND TELL: #44  
Zebras are colored with dark stripes on a light background.

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 31, 2008, 5:19pm UTC](https://www.ruby-forum.com/t/patch-use-g-child-add-when-adding-elements-and-pads/197169/7 "2008-03-31T17:19:15Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] [patch] Use G\_CHILD\_ADD when adding  
elements and pads” on Sun, 30 Mar 2008 11:35:32 +0200,  
Sjoerd S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> It means none of the above. It means that as far as i can tell the patch i’ve  
> attached in this thread follows the coding style which is in most other  
> rubyg-gnome2 files (excluding ruby/gstreamer as that’s mostly a mess). But  
> apparently i got some details wrong. So please instead of telling me that  
> something is wrong, tell me what is wrong so i can fix it and improve it in the  
> other patches too.

OK. I will trust you once.

You can commit your patches that I’ve reviewed without  
fixing your style. I’ll fix your style after you commit.  
But you need to check my fixes, learn from my commits and  
follow our coding-style in the feature commit. OK?

## Thanks,

kou
