1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
from gi.repository import Gtk class PyApp(Gtk.Window): def __init__(self): super(PyApp, self).__init__() self.set_title("Button") self.set_size_request(250, 200) self.set_position(Gtk.WIN_POS_CENTER) btn1 = Gtk.Button("Button") fixed = Gtk.Fixed() fixed.put(btn1, 20, 30) self.connect("destroy", Gtk.main_quit) self.add(fixed) self.show_all() PyApp() Gtk.main()