示例#1
0
    def loginUser(self):
        username = self.txtUser.get()
        password = self.txtPass.get()

        racc = readAccount(username)

        if racc != "":
            if check_password(racc, password):
                msg = messagebox.showinfo("Attendance Login",
                                          "You have logged in Succesfully!")
                if msg:
                    root.destroy()
                    main.vp_start_gui()
            else:
                messagebox.showwarning("Attendance Login", "Invalid Password!")
        else:
            messagebox.showwarning("Attendance Login",
                                   "Invalid Username or Password!")
try:
    import ttk
    py3 = False
except ImportError:
    import tkinter.ttk as ttk
    py3 = True


def set_Tk_var():
    global combobox
    combobox = tk.StringVar()


def init(top, gui, *args, **kwargs):
    global w, top_level, root
    w = gui
    top_level = top
    root = top


def destroy_window():
    # Function which closes the window.
    global top_level
    top_level.destroy()
    top_level = None


if __name__ == '__main__':
    import main
    main.vp_start_gui()
#p_dict_2 = {'geom': "+1000+650", 'instance': 2, 'color' : 'plum'}


def open_two():
    print "open_two starts"
    called.create_Called(root, color="firebrick",
                         instance=1, geom= "+200+650")
    called.create_Called(root, color="plum", instance=2, geom="+1000+650")


def quit():
    sys.exit()

def init(top, gui, *args, **kwargs):
    global w, top_level, root
    w = gui
    top_level = top
    root = top

def destroy_window():
    # Function which closes the window.
    global top_level
    top_level.destroy()
    top_level = None

if __name__ == '__main__':
    import main
    main.vp_start_gui()