local tabs = guiCreateTabPanel(5, 20, width-10, height-25, false, mainWindow)
local tabLogin = guiCreateTab("Login", tabs)
local tabRegister = guiCreateTab("Register", tabs)
local nameStatic = guiCreateLabel((width-60)/2, 5, 60, 20, "Username:", false, tabLogin)
local nameEdit = guiCreateEdit((width-200)/2, 25, 200, 25, "", false, tabLogin) guiEditSetMaxLength(nameEdit, 25) --guiSetProperty(nameEdit, "TextFormatting", "HorzCentred")
local passwdStatic = guiCreateLabel((width-60)/2, 65, 60, 20, "Password:", false, tabLogin)
local passwdEdit = guiCreateEdit((width-200)/2, 83, 200, 25, "", false, tabLogin) guiSetProperty(passwdEdit, "MaskText", "True") guiEditSetMaxLength(passwdEdit, 30)
local loginbtn = guiCreateButton(0.1, 0.8, 0.8, 0.1, "Log Me In", true, tabLogin)
This is my code, loginbtn is invisible when I set relative to false and use pixels. It happens only when I create button in a tab. And in relative mode my button is clicked when I click wherever in Login tab.
My button click event handler (OH, it's register button handler, but they are the same so no matter):
unction sendRegisterRequest(button, state)
if button == "left" and state == "up" then
triggerServerEvent("sendRegisterRequest", getLocalPlayer(), guiGetText(nameEditReg), guiGetText(passwdEditReg), guiGetText(rpasswdEditReg))
end
end
addEventHandler("onClientGUIClick", registerbtn, sendRegisterRequest)