#!/usr/bin/env python2.2

import pygtk
pygtk.require("2.0")

import gtk

def on_button1_clicked(*args):
    entry.insert_text("a",-1)

def on_button2_clicked(*args):
    entry.insert_text("b",-1)

def quit(*args):
    gtk.main_quit()

window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.connect("destroy", quit)

accel_group = gtk.AccelGroup()
window.add_accel_group(accel_group)

box = gtk.VBox(homogeneous=gtk.TRUE)
window.add(box)

entry = gtk.Entry()
box.add(entry)

button1 = gtk.Button("Button 1")
button1.connect("clicked", on_button1_clicked)
button1.add_accelerator("activate", accel_group, gtk.keysyms.KP_1, 0, gtk.ACCEL_VISIBLE)
box.add(button1)

button2 = gtk.Button("Button 2")
button2.connect("clicked", on_button2_clicked)
button2.add_accelerator("activate", accel_group, gtk.keysyms.KP_2, 0, gtk.ACCEL_VISIBLE)
box.add(button2)

window.show_all()

gtk.main()
