guiDeleteTab | Multi Theft Auto: Wiki Skip to content

guiDeleteTab

Client-side
Server-side
Shared

Pair: guiCreateTab

This function deletes a tab from a tab panel.

OOP Syntax Help! I don't understand this!

Syntax

bool guiDeleteTab ( ​gui-tab tabToDelete, ​gui-tabpanel tabPanel )
Required arguments
  • tabToDelete: This is an element representing the tab that you want to delete.
  • tabPanel: This is the tab panel parent that the tab is attached to.

Returns

Returns true the tab was successfully deleted, false otherwise.

  • bool: result

Code Examples

client

This example removes a tab panel if a user LeftCtrl+Clicks a tab panel.

function deleteTabOnClick()
if (getKeyState("lctrl") and getElementType(source) == "gui-tab") then -- if the user is holding down left control
guiDeleteTab(source, getElementParent(source)) -- delete the tab. No need to check if it was actually a tab that was clicked, as this function doesn't work on other controls anyway
end
end
addEventHandler("onClientGUIClick", resourceRoot, deleteTabOnClick) -- add an event handler for clicks

See Also

GUI Functions