function init_loading(app, widget_agent, lua)
--[[	g_WidgetAgent = widget_agent
	g_Lua = lua
	g_App = app

	g_Loader = CLoader(true)]]
	g_Loader:LoadFile("properties/loading.xml")
	local loading = CLuaWindow(g_Loader:GetTemplate("loading"), g_Lua)
	g_WidgetAgent:AddWidget(loading)

	AddLogos(loading, "loading_logos")
end

function loading_update(loading)
	local progress = ConvertToCImageWidget(loading:GetWidget("progress"))

	local k = g_App:GetLoadingThreadProgress()
	
	local width = progress:GetImage():GetImageSize().x * k
	local height = progress:GetImage():GetImageSize().y
	progress:GetImage():SetSourceRect(CRect(0, 0, width, height))
	progress:Resize(width, height)
	
end


function loading_generic_handler(window, action, widget)
	if action=="pressed" then OnLogoPress(widget) end
end