from fm import *

margin = 10
					# Create a scrollable top level window
top = Scrollable()
					# Parent a form to the top window 
mainform = Form(top.embed_where())

					# Add items to the form
mainform.append(EntryItem(mainform, 'Name',    width=(margin,5)))
mainform.append(EntryItem(mainform, 'Owner',   width=(margin,20)))
mainform.append(DropDownEntryItem(mainform, 'Region',  width=(margin,20),
				  values=["red", "green", "blue"]))

					# Add a TextItem
mainform.append(TextItem(mainform, 'Comments', width=(margin,35)))

					# Add a table item to the form
table = TableItem(master=mainform, label='Series',
		  rows=10, columns=5, width=(margin,5),
		  row_labels=range(1,30),
		  column_labels=["a","b","c","d","e","f","h","i",
				 "j","k","l","m","o","p","q","r"])
mainform.append(table)

					# Give the table a value so we
					# have somthing to look at
table.set([[1,2,3,4,5,6,7,8,9,10,11,12],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24],
	   [13,14,15,16,17,18,19,20,21,22,23,24]])

					# Embed (pack) the form in the top
top.embed(mainform, 100, 50)		# item

					# Set the focus
mainform.focus_set()	
					# Reveal all to the user
top.pack(expand=1, fill=BOTH)

					# Tk event loop takes over
top.mainloop()

