import Blender
from Blender.Draw import *
from Blender.BGL import *
from Blender import Window



menu1= "foo%t| foo %x1| foo 2%x2 | foo 2%x2 | etc 2%x2 | etc 2%x2"
menu2= "foo%t| foo %x1| foo 2%x2 | foo 2%x2 | etc 2%x2 | etc 2%x2"
menu3= "foo%t| foo %x1| foo 2%x2 | foo 2%x2 | etc 2%x2 | etc 2%x2"
menu_button1 = Create(1)
menu_button2 = Create(1)
menu_button3 = Create(1)
button_simple = Create(0)

def draw():
	global menu_button1,menu1,menu_button2,menu2,menu_button3,menu3

	glClearColor(0.0, 0.0, 0.0, 0.0)
	glClear(GL_COLOR_BUFFER_BIT)


	#Buttons#
	glColor3f(1.0,1.0,1.0)
	glRasterPos2i(20,20)
	Text("File")
	menu_button1= Menu(menu1, 1, 0, 0, 100, 18, menu_button1.val)
	glRasterPos2i(120,20)
	Text("Draw")
	menu_button2= Menu(menu2, 2, 100, 0, 100, 18, menu_button2.val)
	glRasterPos2i(220,20)
	Text("snap")
	menu_button3= Menu(menu3, 3, 200, 0, 100, 18, menu_button3.val)
	button_simple = Button("Repeat",4 , 300, 0, 80, 19)


def bevent(evt):
	
	if (evt == 1): 
		print "evt = 1"

	if (evt == 2):
		print "evt = 2"
		
	if (evt == 3):
		print "evt = 3"

	if (evt == 4):
		print "Why this?" 
		
	Window.Redraw()

def event(evt, val):
	
	pass

Register(draw, event, bevent)
