# -*- coding: utf-8 -*-
"""
Created on Sat Dec 21 14:03:26 2019

@author: iansh
"""

import myFunc
#From https://www.datacamp.com/community/tutorials/gui-tkinter-python
#First three lines ALWAYS needed??
import tkinter
#from tkinter import *
window = tkinter.Tk()
window.title("GUI")

"""
#label = tkinter.Label(window, text = "Welcome!").pack()
label = tkinter.Label(window, text = "Welcome!")
label.pack()
button_widget = tkinter.Button(window, text = "Welcome!")
button_widget.pack()
"""

""" Frames
top_frame = tkinter.Frame(window)
top_frame.pack()
bottom_frame = tkinter.Frame(window)
bottom_frame.pack(side="bottom")

btn1 = tkinter.Button(top_frame, text = "Button1", fg = "red")
btn1.pack()
btn2 = tkinter.Button(top_frame, text = "Button2", fg = "green")
btn2.pack()
btn3 = tkinter.Button(bottom_frame, text = "Button3", fg = "purple")
btn3.pack(side = "left")
btn4 = tkinter.Button(bottom_frame, text = "Button4", fg = "orange")
btn4.pack(side = "left")
"""

"""
# check buttons and gridding
CheckVar1 = IntVar()
CheckVar2 = IntVar()

btn1 = tkinter.Checkbutton(window, text = "Option 1", variable = CheckVar1, onvalue = 1, offvalue = 0)
btn1.grid(row = 0, sticky = W)
btn2 = tkinter.Checkbutton(window, text = "Option 2", variable = CheckVar2, onvalue = 0, offvalue = 1)
btn2.grid(row = 1, sticky = W)
"""

"""
#Entry boxes and gridding
label1 = tkinter.Label(window, text = "Username")
label1.grid(row = 0)
entry1 = tkinter.Entry(window)
entry1.grid(row = 0, column = 1)
label2 = tkinter.Label(window, text = "Password")
label2.grid(row = 1)
entry2 = tkinter.Entry(window)
entry2.grid(row = 1, column = 1)
btn1 = tkinter.Checkbutton(window, text = "Stay logged in")
btn1.grid(columnspan = 2)
"""

""" Move to other source file
#Binding function

def myFunc():
    label = tkinter.Label(window, text = "Welcome!")
    label.pack()
    
btn = tkinter.Button(window, text = "Button1", command = myFunc)
btn.pack()
"""

"""
#This approach does NOT work!
btn = tkinter.Button(window, text = "Button1", command = myFunc(window))
btn.pack()
"""



window.mainloop()

