All pastes #907832 Raw Edit

Untitled

public text v1 · immutable
·published 2008-02-17 22:33 UTC
rendered paste body
local resourceRoot = getResourceRootElement(getThisResource())
local testWindow = nil
local x,y = guiGetScreenSize()

function resourceStart()
	testWindow = guiCreateWindow( (x/2)-(x/2.7), (y/2)-(y/2.6), 600, 450, "test panel", false )
		guiSetText( testWindow, "test panel" )
		guiWindowSetSizable( testWindow, false )
	
	guiSetVisible( testWindow, true )
	
	testPanel = guiCreateTabPanel( 0, 0.06, 1, 1, true, testWindow )
	guiCreateTab( "Main", testPanel )
end
addEventHandler ( "onClientResourceStart", resourceRoot, resourceStart )

function resourceStop()
end
addEventHandler ( "onClientResourceStop", resourceRoot, resourceStop )

function deleteTabOnClick ()
	if ( getKeyState ( "lctrl" ) == true ) and ( getElementType ( source ) == "gui-tab" ) then
		guiDeleteTab ( source )
		outputChatBox ( "clicked" ) -- this won't show in chatbox. If i comment out "guiDeleteTab", it does
	end
end
addEventHandler ( "onClientGUIClick", resourceRoot, deleteTabOnClick  )