container_images.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:dockyard 作者: maidstone-hackspace 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号