oneconfviews.py 文件源码

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

项目:x-mario-center 作者: fossasia 项目源码 文件源码
def get_test_window():

    w = OneConfViews(Gtk.IconTheme.get_default())
    w.show()

    win = Gtk.Window()
    win.set_data("pane", w)
    win.add(w)
    win.set_size_request(400, 600)
    win.connect("destroy", lambda x: Gtk.main_quit())

    # init the view
    w.register_computer("AAAAA", "NameA")
    w.register_computer("ZZZZZ", "NameZ")
    w.register_computer("DDDDD", "NameD")
    w.register_computer("CCCCC", "NameC")
    w.register_computer("", "This computer should be first")
    w.select_first()

    GObject.timeout_add_seconds(5, w.register_computer, "EEEEE", "NameE")

    def print_selected_hostid(widget, hostid, hostname):
        print "%s selected for %s" % (hostid, hostname)

    w.connect("computer-changed", print_selected_hostid)

    w.remove_computer("DDDDD")
    win.show_all()
    return win
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号