# Making Gtk::ActionGroup#add\_action return added Gtk::Action,

**URL:** <https://www.ruby-forum.com/t/making-gtk-actiongroup-add-action-return-added-gtk-action/86209>\
**Category:** Ruby-Gnome 2\
**Created:** [February 20, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/making-gtk-actiongroup-add-action-return-added-gtk-action/86209 "2007-02-20T18:00:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Nordholts](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/df705f/32.png) [@Martin\_Nordholts](https://www.ruby-forum.com/u/Martin_Nordholts)\
**Post date:** [February 20, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/making-gtk-actiongroup-add-action-return-added-gtk-action/86209/1 "2007-02-20T18:00:26Z")

</div>

Hello.

I’m working on a Ruby-GNOME2 app and use Gtk::ActionGroup and friends.

How about making Gtk::ActionGroup#add\_action return the added  
Gtk::Action instead of self? That way one could write

actionGroup.add\_action( Gtk::Action.new( “stuff” )).signal\_connect(  
“activate” ) { stuff() }

instead of e.g.

newAction = Gtk::Action.new “stuff”  
newAction.signal\_connect( “activate” ) { stuff() }  
actionGroup.add\_action newAction

The patch will be trivial, but before I submit it, is there some benefit  
of making it return self instead of the added Gtk::ActionGroup which I  
foresee?

- Martin Nordholts

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys-and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)
