#! /usr/bin/env python
#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 6.2
#  in conjunction with Tcl version 8.6
#    Jun 08, 2021 01:28:14 PM EEST  platform: Windows NT

from PIL import ImageTk,Image
import sys

try:
    import Tkinter as tk
except ImportError:
    import tkinter as tk

try:
    import ttk
    py3 = False
except ImportError:
    import tkinter.ttk as ttk
    py3 = True

import HomeMenuGUI_support

def vp_start_gui():
    '''Starting point when module is the main routine.'''
    global val, w, root
    root = tk.Tk()
    top = Toplevel1 (root)
    HomeMenuGUI_support.init(root, top)
    root.mainloop()

w = None
def create_Toplevel1(rt, *args, **kwargs):
    '''Starting point when module is imported by another module.
       Correct form of call: 'create_Toplevel1(root, *args, **kwargs)' .'''
    global w, w_win, root
    #rt = root
    root = rt
    w = tk.Toplevel (root)
    top = Toplevel1 (w)
    HomeMenuGUI_support.init(w, top, *args, **kwargs)
    return (w, top)

def destroy_Toplevel1():
    global w
    w.destroy()
    w = None


#Start of custom functions

def GoToLoginPage():
    import LoginPage as log
    root = tk.Toplevel()#Tk()
    login_page=log.LoginToplevel(root)

    root.mainloop()
    

class Toplevel1:
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#d9d9d9' # X11 color: 'gray85'
        _ana1color = '#d9d9d9' # X11 color: 'gray85'
        _ana2color = '#ececec' # Closest X11 color: 'gray92'

        top.geometry("600x450+660+210")
        top.minsize(148, 1)
        top.maxsize(4804, 1325)
        top.resizable(1,  1)
        top.title("New Toplevel")
        top.configure(background="#d9d9d9")
        top.configure(highlightbackground="#d9d9d9")
        top.configure(highlightcolor="black")

        self.WhatnauLogoCanvas = tk.Canvas(top)
        self.WhatnauLogoCanvas.place(relx=0.167, rely=0.067, relheight=0.829
                , relwidth=0.622)
        self.WhatnauLogoCanvas.configure(background="#d9d9d9")
        self.WhatnauLogoCanvas.configure(borderwidth="2")
        self.WhatnauLogoCanvas.configure(highlightbackground="#d9d9d9")
        self.WhatnauLogoCanvas.configure(highlightcolor="black")
        self.WhatnauLogoCanvas.configure(insertbackground="black")
        self.WhatnauLogoCanvas.configure(relief="ridge")
        self.WhatnauLogoCanvas.configure(selectbackground="#0000ffffffff")
        self.WhatnauLogoCanvas.configure(selectforeground="white")
        
        img=Image.open('my_Whatnaulogo.png')
        self.WhatnauLogoCanvas.image=ImageTk.PhotoImage(img)
        self.WhatnauLogoCanvas.create_image(0,0,image=self.WhatnauLogoCanvas.image,anchor='nw')


        

        self.OrganiserButton = tk.Button(self.WhatnauLogoCanvas,command=GoToLoginPage)
        self.OrganiserButton.place(relx=0.268, rely=0.751, height=33, width=156)
        self.OrganiserButton.configure(activebackground="#ececec")
        self.OrganiserButton.configure(activeforeground="#000000")
        self.OrganiserButton.configure(background="#d9d9d9")
        self.OrganiserButton.configure(disabledforeground="#a3a3a3")
        self.OrganiserButton.configure(foreground="#000000")
        self.OrganiserButton.configure(highlightbackground="#d9d9d9")
        self.OrganiserButton.configure(highlightcolor="black")
        self.OrganiserButton.configure(pady="0")
        self.OrganiserButton.configure(text='''Login as Organiser''')

        self.SimpleUserButton = tk.Button(self.WhatnauLogoCanvas)#,command=GoToLoginPage)
        self.SimpleUserButton.place(relx=0.268, rely=0.885, height=33, width=156)

        self.SimpleUserButton.configure(activebackground="#ececec")
        self.SimpleUserButton.configure(activeforeground="#000000")
        self.SimpleUserButton.configure(background="#d9d9d9")
        self.SimpleUserButton.configure(disabledforeground="#a3a3a3")
        self.SimpleUserButton.configure(foreground="#000000")
        self.SimpleUserButton.configure(highlightbackground="#d9d9d9")
        self.SimpleUserButton.configure(highlightcolor="black")
        self.SimpleUserButton.configure(pady="0")
        self.SimpleUserButton.configure(text='''Login as Simple User''')

        self.Label1 = tk.Label(top)
        self.Label1.place(relx=0.35, rely=0.0, height=26, width=192)
        self.Label1.configure(activebackground="#f9f9f9")
        self.Label1.configure(activeforeground="black")
        self.Label1.configure(background="#d9d9d9")
        self.Label1.configure(disabledforeground="#a3a3a3")
        self.Label1.configure(foreground="#000000")
        self.Label1.configure(highlightbackground="#d9d9d9")
        self.Label1.configure(highlightcolor="black")
        self.Label1.configure(text='''Welcome To Whatnau App''')

if __name__ == '__main__':
    vp_start_gui()





