def __init__(self, tasklist = None):
Gtk.Dialog.__init__(self)
if tasklist == None:
self.set_title(comun.APPNAME + ' | '+_('Add new tasklist'))
else:
self.set_title(comun.APPNAME + ' | '+_('Edit tasklist'))
self.set_modal(True)
self.add_buttons(Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT,Gtk.STOCK_CANCEL,Gtk.ResponseType.CANCEL)
self.set_size_request(200, 80)
self.set_resizable(False)
self.set_icon_from_file(comun.ICON)
#
vbox0 = Gtk.VBox(spacing = 5)
vbox0.set_border_width(5)
self.get_content_area().add(vbox0)
#
table1 = Gtk.Table(n_rows = 1, n_columns = 2, homogeneous = False)
table1.set_border_width(5)
table1.set_col_spacings(5)
table1.set_row_spacings(5)
vbox0.add(table1)
#
label11 = Gtk.Label.new(_('Title')+':')
label11.set_alignment(0,.5)
table1.attach(label11,0,1,0,1, xoptions = Gtk.AttachOptions.FILL, yoptions = Gtk.AttachOptions.FILL)
#
self.entry1 = Gtk.Entry()
self.entry1.set_width_chars(60)
table1.attach(self.entry1,1,2,0,1, xoptions = Gtk.AttachOptions.EXPAND, yoptions = Gtk.AttachOptions.SHRINK)
#
if tasklist is not None:
if 'title' in tasklist.keys():
self.entry1.set_text(tasklist['title'])
self.show_all()
评论列表
文章目录