PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/script_binding/lua/demo_entry.lua

http://ftk.googlecode.com/
Lua | 40 lines | 28 code | 12 blank | 0 comment | 0 complexity | 63e4f3642d13d234fcd7e13715dcc0fa MD5 | raw file
 1function OnQuit(button)
 2	Ftk.Quit()
 3
 4	return RET_OK
 5end
 6
 7function AppInit()
 8	win=FtkAppWindow.Create()
 9	win:SetText("Demo entry")
10	win:SetAttr(FTK_ATTR_QUIT_WHEN_CLOSE)
11	
12	width=win:Width()
13	height=win:Height()
14
15	entry=FtkEntry.Create(win, 10, 30, width - 20, 30);
16	entry:SetText("Single line editor")
17
18	entry=FtkEntry.Create(win, 10, 80, width - 20, 30)
19	entry:SetText("Single line editor, that means you can input a one line only.")
20
21	entry=FtkEntry.Create(win, 10, 130, width - 20, 30);
22	entry:SetText("Single line editor, ?????????????.")
23
24	button=FtkButton.Create(win, width/4, height/2, width/2, 60)
25	button:SetText("Quit")
26	button:SetClickedListener("OnQuit")
27	
28	entry=FtkEntry.Create(win, 10, height-60, width - 20, 30)
29	entry:SetText("Single line editor, that means you can input a one line only.")
30
31	win:SetFocus(button)
32	win:ShowAll(1)
33
34	return 1
35end
36
37Ftk.Init(1, {"entry"})
38AppInit()
39Ftk.Run()
40