# Ruby & libglade & menu shortcut

**URL:** <https://www.ruby-forum.com/t/ruby-libglade-menu-shortcut/76167>\
**Category:** Ruby-Gnome 2\
**Created:** [November 16, 2006, 11:01am UTC](https://www.ruby-forum.com/t/ruby-libglade-menu-shortcut/76167 "2006-11-16T11:01:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laurent\_Marzullo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a183cd/32.png) [@Laurent\_Marzullo](https://www.ruby-forum.com/u/Laurent_Marzullo)\
**Post date:** [November 16, 2006, 11:01am UTC](https://www.ruby-forum.com/t/ruby-libglade-menu-shortcut/76167/1 "2006-11-16T11:01:15Z")

</div>

Hello,

I’m trying to use libglade wirh Ruby.

I’ve defined a little main window (gnome application window) and I load  
it like  
this:

class ApplicationWindow \< Gtk:Window  
def initialize( app\_name , app\_version )  
super( “#{app\_name} - #{app\_version}” )  
@glade = GladeXML.new( ‘grgl’ ,  
‘gargoyle\_main\_window\_bonobodock’ , nil  
)  
do |h|  
method( h )  
end  
self.set\_default\_size( 400 , 200 )  
self.add( @glade[‘gargoyle\_main\_window\_bonobodock’] )  
end  
end

The ‘gargoyle\_main\_window\_bonobodock’ is the default bonobodock widget  
created  
by glade when creating a new ‘Gnome Application Window’.

I’ve define a handler ‘on\_quit\_activate’ which is normally activated  
when  
choosing the ‘Quit’ Menu item into the file menu. This handler is called  
when  
choosing ‘Quit’ with the mouse but not when pressing ‘Ctrl-Q’, which is  
normally the shortcut for ‘Quit’ ?

May I create Gtk::AccelGroup and add all AccelMap entry myself ? or is  
there any  
way to tell libglade to load the shortcut ?

Thanks all

±-------------------+

- Laurent Marzullo
- 

* * *

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)
