Fltk win.show() 不展示

2024-05-08 02:55:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我不能让fltk窗口显示你的手。是吗飞行表演()必须在功能之外?这是我纸牌游戏程序的一部分。你知道吗

def makecards(Fl_Return_Button):
    global c
    yourhand=Fl_Window(100,100,1300,145,'Your Cards')
    yourhand.begin()
    for x in range(NUM_CARDS):
        while True:
            cv = random.randint(2,14)#value
            cs = random.randint(0,3)#suit

            if (cv, cs) not in hand:
                break
        hand.append((cv, cs))
        c+=100
        b=Fl_Button(c,0,100,140)
        b.label(str(SUITS[cs][1]))
        order=Fl_Input(210,250,80,40)
        submit=Fl_Return_Button(210,300,80,40,'Submit')
        b.redraw()
    yourhand.end()
    yourhand.show()

Tags: in程序功能游戏returnbuttonrandomcs