LexicGUILauncher.py 文件源码

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

项目:Lexic 作者: RasmusRendal 项目源码 文件源码
def createButtons(amount):
    print ("[GUI] Creating " + str(amount) + " buttons")
    for i in range(1, amount + 1):
        #Add the buttons to the window class
        setattr(win, "prediction" + str(i), Gtk.Button(label = "Prediction #" + str(i)))
        #Add the buttons to the box
        win.box.pack_start(getattr(win, "prediction" + str(i)), True, True, 0)
        #Connect the buttons clicked event to the on_prediction_click function
        getattr(win, "prediction" + str(i)).connect("clicked", on_prediction_click, i)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号