Esempio n. 1
0
def tableGUI():
    langPath=loadGUI()
    try:
        lang = Language(langPath)
    except Exception:
        showMessage("The Chosen file in not a language file , try again")
        
    
    def submit():
        Action(lang, int(numOfCluster.get()),(stream.get(),addDB.get(),cluster.get()))

    window = Tk()
    
    window.geometry("600x300")
    window.resizable(0, 0)
    window.title("NAC - Loaded News Articles")
    mylabel = Label(window, text="Chosen language path :")
    mylabel.place(x=0, y=0, height=20, width=600)
    #Test
    mylabel = Label(window, text="Current stored articles : {0}".format(len(lang.getArticles())))
    mylabel.place(x=0, y=40, height=20, width=600)
    Label(window, text=langPath).place(x=0, y=20, height=20, width=600)


    stream = IntVar()
    Checkbutton(window, text="Stream", variable=stream).place(x=0, y=60, height=20, width=600)
    addDB = IntVar()
    Checkbutton(window, text="Add To DataBase", variable=addDB).place(x=0, y=80, height=20, width=600)
    cluster = IntVar()
    Checkbutton(window, text="Cluster", variable=cluster).place(x=0, y=100, height=20, width=600)


    Label(window, text="Number of clusters:").place(x=0, y=180, height=20, width=600)

    numOfCluster = Entry(window)
    numOfCluster.insert(10,"2")

    numOfCluster.place(x=0, y=200, height=20, width=600)

    
    Button(window, text='Quit', command=window.destroy).place(x=0, y=270, height=20, width=600)
    Button(window, text='Submit', command=submit).place(x=0, y=250, height=20, width=600)


    window.mainloop()