def add_image(self, name):
row = Gtk.ListBoxRow()
row.set_activatable(True)
row.set_selectable(True)
row.connect('activate', self.popup_menu)
label = Gtk.Label(name)
label.set_justify(Gtk.Justification.LEFT)
label.set_halign(Gtk.Justification.LEFT)
label.set_xalign(0)
layout_box = Gtk.Box()
layout_box.pack_start(label, True, False, 5)
if self.showing_local_images is True:
remove_button = Gtk.Button(label='Remove')
remove_button.connect('button_press_event', self.remove_image, name)
layout_box.add(remove_button)
else:
pull_button = Gtk.Button(label='Pull')
pull_button.connect('button_press_event', self.pull_image, name)
layout_box.add(pull_button)
run_button = Gtk.Button(label='Run')
run_button.connect('button_press_event', self.launch_image, name)
layout_box.add(run_button)
row.add(layout_box)
self.widget_image_list.add(row)
评论列表
文章目录