On 08/16/2010 12:58 PM, chaouche yacine wrote:
Hello,

I want my application to quit when I press ctrl-q. I don't want to have menus. 
What is the simplest way to do this ? what is the best way to do this ?

My code is as simple as :

<code>
import pygtk
pygtk.require("2.0")
import gtk

w = gtk.Window()
accel_group = gtk.AccelGroup()
accel_group.connect_group(ord('q'), gtk.gdk.CONTROL_MASK, gtk.ACCEL_LOCKED, gtk.main_quit)
w.add_accel_group(accel_group)

(untested)
w.show()
gtk.main()
</code>

What should I add to this code to make it happen ?

Thank you for you help.


Y.Chaouche



_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to