OK - Works, better to use Fixed widget not table or grid.
#!/usr/bin/python
import gtk
class PyApp(gtk.Window):
def __init__(self):
super(PyApp, self).__init__()
""" Window - Background embed """
button_rc = """
pixmap_path "/var/tmp"
# Button - image apply
style "window" {
bg_pixmap[NORMAL] = "menu/keyboard_new.png"
}
style "deButton" {
fg[PRELIGHT] = { 0, 1.0, 1.0 }
bg[PRELIGHT] = { 0, 0, 1.0 }
bg[ACTIVE] = { 1.0, 0, 0 }
fg[ACTIVE] = { 0, 1.0, 0 }
bg[NORMAL] = { 1.0, 1.0, 0 }
fg[NORMAL] = { .99, 0, .99 }
bg[INSENSITIVE] = { 1.0, 1.0, 1.0 }
fg[INSENSITIVE] = { 1.0, 0, 1.0 }
engine "pixmap" {
image {
function = BOX
file = "menu/commonbutton1.png"
stretch = TRUE
}
}
bg_pixmap[NORMAL] = "menu/commonbutton1.png"
}
# imports
widget "*.deButton" style "deButton"
widget_class "*GtkButton*" style "button"
widget_class "GtkWindow" style "window"
"""
self.set_title("Keyboard")
self.set_size_request(600, 300)
self.set_position(gtk.WIN_POS_CENTER)
gtk.rc_parse_string(button_rc) ##<<<<< include the design
vbox = gtk.VBox(False, 2)
fix = gtk.Fixed() ## YumYumYum
""" Row 1 """
fix.put( gtk.Button("1") , 20 , 20 )
fix.put( gtk.Button("2") , 80 , 20 )
fix.put( gtk.Button("3") , 150 , 20 )
""" Row 2 """
fix.put( gtk.Button("Q") , 20 , 80 )
""" Row 3 """
fix.put( gtk.Button("A") , 60 , 130 )
""" Row 4 """
fix.put( gtk.Button("Z") , 60 , 190 )
""" Row 5 """
fix.put( gtk.Button("SPACE") , 180 , 240 )
vbox.pack_end(fix, True, True, 0)
self.add(vbox)
self.connect("destroy", gtk.main_quit)
self.show_all()
PyApp()
gtk.main()