Python,通过GUI传递和更新列表的值(复选框)

时间:2016-10-03 02:22:58

标签: python list user-interface checkbox global-variables

我在GUI中有6个复选框。

 SplashScreen splash = SplashScreen.getSplashScreen();
 if(splash != null)
 {
    try 
    {                
        Thread.sleep(2000); //Leave Splash up for 2 seconds
        splash.close();
    }
    catch(InterruptedException e) { LOG.log(Level.INFO, "Spash Sleep Interrupted", e); }
 }
 else
 {
    LOG.info("Splash Screen is null");
 }

当按下检查按钮时,它将值0传递给函数check_button,这基本上表示它是列表中的第一个复选按钮。

chk_b = [0, 0, 0, 0, 0, 0] #Create a list to hold 6 buttons 

chk_0 = Checkbutton(window, text = "Technology", command = check_button(0)) #FirstCheckButton
chk_0.pack()

我遇到的问题是,在我检查完复选框后,当我打印所有值时,它们仍然等于0.

0 个答案:

没有答案