# Small fix for some GtkAction subclasses

**URL:** <https://www.ruby-forum.com/t/small-fix-for-some-gtkaction-subclasses/78896>\
**Category:** Ruby-Gnome 2\
**Created:** [December 10, 2006, 5:54am UTC](https://www.ruby-forum.com/t/small-fix-for-some-gtkaction-subclasses/78896 "2006-12-10T05:54:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sweetpete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Post date:** [December 10, 2006, 5:54am UTC](https://www.ruby-forum.com/t/small-fix-for-some-gtkaction-subclasses/78896/1 "2006-12-10T05:54:42Z")

</div>

Attached is a patch which fixes some issues I ran into trying to use  
Gtk::RadioAction and Gtk::ToggleAction in a program I’m working on. It  
mostly just brings the initializer methods into line to match the  
Gtk::Action initialize methods.

Without these patches, you can’t pass nil for the tooltip parameter or  
the stock\_id parameter in Gtk::ToggleAction.new or Gtk::RadioAction.new.

-pete

---

<div class="post-metadata">

**Author:** ![sweetpete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Post date:** [December 10, 2006, 2:59pm UTC](https://www.ruby-forum.com/t/small-fix-for-some-gtkaction-subclasses/78896/2 "2006-12-10T14:59:11Z")

</div>

Hi,

Thanks. Applied to CVS.

On Sat, 9 Dec 2006 20:54:29 -0800  
Peter J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Attached is a patch which fixes some issues I ran into trying to use  
> Gtk::RadioAction and Gtk::ToggleAction in a program I’m working on. It  
> mostly just brings the initializer methods into line to match the  
> Gtk::Action initialize methods.
> 
> Without these patches, you can’t pass nil for the tooltip parameter or  
> the stock\_id parameter in Gtk::ToggleAction.new or Gtk::RadioAction.new.
> 
> -pete

* * *

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)

---

<div class="post-metadata">

**Author:** ![sweetpete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Post date:** [December 10, 2006, 4:09pm UTC](https://www.ruby-forum.com/t/small-fix-for-some-gtkaction-subclasses/78896/3 "2006-12-10T16:09:18Z")

</div>

Peter J. [2006-12-09 20:54]:

> [snip]
> 
> ```
> if (TYPE(stock_id) == T_STRING){
> gstock = RVAL2CSTR(stock_id);
> 
> ```
> 
> - } else {
> 
> - } else if (TYPE(stock\_id) == T\_STRING){  
> gstock = rb\_id2name(SYM2ID(stock\_id));  
> }

This part of the patch looks suspicious 🙂  
Maybe the second line should check for T\_SYMBOL?

Regards,  
Tilman

---

<div class="post-metadata">

**Author:** ![sweetpete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Post date:** [December 10, 2006, 4:15pm UTC](https://www.ruby-forum.com/t/small-fix-for-some-gtkaction-subclasses/78896/4 "2006-12-10T16:15:19Z")

</div>

Hi,

Yes. I noticed it and I fixed it before I checked it in CVS.

On Sun, 10 Dec 2006 16:07:19 +0100  
Tilman S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> This part of the patch looks suspicious 🙂

* * *

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)

---

<div class="post-metadata">

**Author:** ![sweetpete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@sweetpete](https://www.ruby-forum.com/u/sweetpete)\
**Post date:** [December 10, 2006, 6:35pm UTC](https://www.ruby-forum.com/t/small-fix-for-some-gtkaction-subclasses/78896/5 "2006-12-10T18:35:32Z")

</div>

On Sun, Dec 10, 2006 at 04:07:19PM +0100, Tilman S. wrote:

> This part of the patch looks suspicious 🙂  
> Maybe the second line should check for T\_SYMBOL?

Oy! Indeed. Glad it got caught and fixed before getting commited. Sorry  
about that.

-pete

* * *

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)
