#!/usr/bin/env python

from os import system
import curses
import gui

# Keep in mind that this is a very simple toggling UI
# using ncurses. It will not check if your terminal 
# window is big enough etc. Make sure it is, though.
window = [False,False]
offset = 0
x = 1

# main loop
while x != ord('q'):
	screen = curses.initscr()
	users = ["vz","yaMatt","woofgdgsdgdfgdfgt","woot","woot","woot"]
	emails = ["woot@email.com","blabla@hotmail.com"]
	user_input = [["08:12:45","yaMatt","This is a test message"],["09:15:32","vz;","I am late it seems I am late it seems I am late it seems I am late it seems I am late it seems"]]
	user_input.append(["08:12:45","yaMatt","This is a test message"])
	user_input.append(["08:12:45","yaMatt","This is a test message"])
	user_input.append(["08:13:45","vz","Stop spamming"])
	user_input.append(["08:14:45","yaMatt","This is a test message"])
	user_input.append(["08:15:45","yaMatt","This is a test message!"])
	user_input.append(["08:17:45","vz","Seriously, thats quite annoying. Stop it damn you. You are making me crazy."])
	user_input.append(["08:22:45","yaMatt","This is a fictonal test message"])
	user_input.append(["08:55:45","yaMatt","This conversation is just made up"])
	user_input.append(["08:59:45","yaMatt","This is a test message"])
	user_input.append(["09:12:45","vz","..."])
	user_input.append(["10:12:45","yaMatt","This is a test message"])
	user_input.append(["12:12:45","yaMatt","This is a test message!!!111111"])
	user_input.append(["19:12:45","vz","My turn!"])
	user_input.append(["22:12:45","vz","12312314tgdhsrtegrghrtgdrfhkhfgdfsdfsdf!"])
	user_input.append(["00:12:45","vz","This is a test message, 23894r g,ds fsdf8ig f,gfd 8igfh kol"])
	gui.chatWindows(screen,users,emails,window,user_input)

	x = screen.getch()
	# Trying to toggle the boolean, accordingly to input.
	try: window[int(chr(x))-1] = not window[int(chr(x))-1]
	except: """ not a number """
	screen.refresh()
		
curses.endwin()

