PageRenderTime 575ms CodeModel.GetById 274ms app.highlight 3ms RepoModel.GetById 149ms app.codeStats 0ms

/script_binding/lua/demo_fullscreen.lua

http://ftk.googlecode.com/
Lua | 46 lines | 34 code | 12 blank | 0 comment | 0 complexity | c05ee4b94d22f6842a24ab77d5de0e00 MD5 | raw file
 1function OnQuit(button)
 2	print("OnQuit: " .. button:GetText())
 3	Ftk.Quit()
 4
 5	return RET_OK
 6end
 7
 8function OnFullscreen(button)
 9	button:Toplevel():SetFullscreen(1)	
10	return RET_OK
11end
12
13function OnUnfullscreen(button)
14	button:Toplevel():SetFullscreen(0)	
15	return RET_OK
16end
17
18function AppInit()
19	win=FtkAppWindow.Create()
20	win:SetText("Demo fullscreen")
21	win:SetAttr(FTK_ATTR_QUIT_WHEN_CLOSE)
22	
23	width=win:Width()
24	height=win:Height()
25
26	button=FtkButton.Create(win, 0, 30, width/3, 50)
27	button:SetText("??")
28	button:SetClickedListener("OnFullscreen")
29
30	button=FtkButton.Create(win, 2*width/3, 30, width/3, 50);
31	button:SetText("??")
32	button:SetClickedListener("OnUnfullscreen")
33	
34	button=FtkButton.Create(win, width/3, height/2, width/3, 50);
35	button:SetText("Quit")
36	button:SetClickedListener("OnQuit")
37
38	win:ShowAll(1)
39
40	return 1
41end
42
43Ftk.Init(1, {"fullscreen"})
44AppInit()
45Ftk.Run()
46