def __init__(self, store, iter=None):
self.grid = Gtk.Grid()
self.grid.set_border_width(5)
self.grid.set_row_spacing(5)
self.grid.set_vexpand(True)
self.grid.set_hexpand(True)
self.grid.set_column_spacing(2)
self.grid.set_column_homogeneous(False)
label1 = Gtk.Label('key sentence')
label1.set_hexpand(True)
label1.set_justify(Gtk.Justification.LEFT)
label1.set_halign(Gtk.Align.START)
label2 = Gtk.Label('your command')
label2.set_justify(Gtk.Justification.LEFT)
label2.set_halign(Gtk.Align.START)
ll = Gtk.Label()
ll.set_vexpand(True)
self.entry1 = Gtk.Entry()
self.entry2 = Gtk.Entry()
if iter is not None:
self.entry1.set_text(store[iter][0])
self.entry2.set_text(store[iter][1])
button = Gtk.Button.new_from_stock(Gtk.STOCK_OK)
button.connect("clicked", self.button_clicked, store, iter)
button_cancel = Gtk.Button.new_from_stock(Gtk.STOCK_CANCEL)
button_cancel.connect("clicked", self.do_destroy)
self.grid.attach(label1, 0, 0, 11, 1)
self.grid.attach(self.entry1, 11, 0, 4, 1)
self.grid.attach(label2, 0, 1, 11, 1)
self.grid.attach(self.entry2, 11, 1, 4, 1)
self.grid.attach(ll, 0, 2, 15, 1)
self.grid.attach(button_cancel, 13, 3, 1, 1)
self.grid.attach(button, 14, 3, 1, 1)
self.grid.show_all()
评论列表
文章目录