GuiGridListClear: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 17: | Line 17: | ||
This example creates a grid list, puts 2 items in to display the text "Hello" and "world" and clears the grid list after 5 seconds. | This example creates a grid list, puts 2 items in to display the text "Hello" and "world" and clears the grid list after 5 seconds. | ||
<syntaxhighlight lang="lua">function clientsideResourceStart () | <syntaxhighlight lang="lua">function clientsideResourceStart () | ||
local testList = guiCreateGridList ( 0.45, 0.45, 0.15, 0.15, true ) | -- Create the grid list element | ||
local testList = guiCreateGridList ( 0.45, 0.45, 0.15, 0.15, true ) | |||
-- Create a column in the list and add 2 rows displaying "Hello" text and "world" text | |||
local column = guiGridListAddColumn( testList, "test", 0.85 ) | |||
guiGridListSetItemText ( testList, guiGridListAddRow ( testList ), column, "Hello", false, false ) | guiGridListSetItemText ( testList, guiGridListAddRow ( testList ), column, "Hello", false, false ) | ||
guiGridListSetItemText ( testList, guiGridListAddRow ( testList ), column, "World", false, false ) | guiGridListSetItemText ( testList, guiGridListAddRow ( testList ), column, "World", false, false ) | ||
-- Set a timer to call the guiGridListClear function to clear the grid list items in 5 seconds | |||
setTimer ( guiGridListClear, 5000, 1, testList ) | |||
end | end | ||
addEventHandler ( "onClientResourceStart", getRootElement(), clientsideResourceStart )</syntaxhighlight> | addEventHandler ( "onClientResourceStart", getRootElement(), clientsideResourceStart )</syntaxhighlight> |
Revision as of 07:40, 9 October 2007
This function clears all the data from a grid list.
Syntax
bool guiGridListClear ( element gridList )
Required Arguments
- gridList: The grid list element to be cleared
Returns
Returns true if the grid list element is valid and has been cleared successfully, false otherwise.
Example
This example creates a grid list, puts 2 items in to display the text "Hello" and "world" and clears the grid list after 5 seconds.
function clientsideResourceStart () -- Create the grid list element local testList = guiCreateGridList ( 0.45, 0.45, 0.15, 0.15, true ) -- Create a column in the list and add 2 rows displaying "Hello" text and "world" text local column = guiGridListAddColumn( testList, "test", 0.85 ) guiGridListSetItemText ( testList, guiGridListAddRow ( testList ), column, "Hello", false, false ) guiGridListSetItemText ( testList, guiGridListAddRow ( testList ), column, "World", false, false ) -- Set a timer to call the guiGridListClear function to clear the grid list items in 5 seconds setTimer ( guiGridListClear, 5000, 1, testList ) end addEventHandler ( "onClientResourceStart", getRootElement(), clientsideResourceStart )
See Also
General functions
- guiBringToFront
- getChatboxLayout
- getChatboxCharacterLimit
- guiCreateFont
- guiBlur
- guiFocus
- guiGetAlpha
- guiGetCursorType
- guiGetEnabled
- guiGetFont
- guiGetInputEnabled
- guiGetInputMode
- guiGetPosition
- guiGetProperties
- guiGetProperty
- guiGetScreenSize
- guiGetSize
- guiGetText
- guiGetVisible
- guiMoveToBack
- guiSetAlpha
- guiSetEnabled
- guiSetFont
- guiSetInputEnabled
- guiSetInputMode
- guiSetPosition
- guiSetProperty
- guiSetSize
- guiSetText
- guiSetVisible
- isChatBoxInputActive
- isConsoleActive
- isDebugViewActive
- isMainMenuActive
- isMTAWindowActive
- isTransferBoxActive
- setChatboxCharacterLimit
- setDebugViewActive
Browsers
Buttons
Checkboxes
Comboboxes
- guiCreateComboBox
- guiComboBoxAddItem
- guiComboBoxClear
- guiComboBoxGetItemCount
- guiComboBoxGetItemText
- guiComboBoxGetSelected
- guiComboBoxIsOpen
- guiComboBoxRemoveItem
- guiComboBoxSetItemText
- guiComboBoxSetOpen
- guiComboBoxSetSelected
Edit Boxes
- guiCreateEdit
- guiEditGetCaretIndex
- guiEditGetMaxLength
- guiEditIsMasked
- guiEditIsReadOnly
- guiEditSetCaretIndex
- guiEditSetMasked
- guiEditSetMaxLength
- guiEditSetReadOnly
Gridlists
- guiCreateGridList
- guiGridListAddColumn
- guiGridListAddRow
- guiGridListAutoSizeColumn
- guiGridListClear
- guiGridListGetColumnCount
- guiGridListGetColumnTitle
- guiGridListGetColumnWidth
- guiGridListGetHorizontalScrollPosition
- guiGridListGetItemColor
- guiGridListGetItemData
- guiGridListGetItemText
- guiGridListGetRowCount
- guiGridListGetSelectedCount
- guiGridListGetSelectedItem
- guiGridListGetSelectedItems
- guiGridListGetSelectionMode
- guiGridListIsSortingEnabled
- guiGridListGetVerticalScrollPosition
- guiGridListInsertRowAfter
- guiGridListRemoveColumn
- guiGridListRemoveRow
- guiGridListSetColumnTitle
- guiGridListSetColumnWidth
- guiGridListSetHorizontalScrollPosition
- guiGridListSetItemColor
- guiGridListSetItemData
- guiGridListSetItemText
- guiGridListSetScrollBars
- guiGridListSetSelectedItem
- guiGridListSetSelectionMode
- guiGridListSetSortingEnabled
- guiGridListSetVerticalScrollPosition
Memos
- guiCreateMemo
- guiMemoGetCaretIndex
- guiMemoGetVerticalScrollPosition
- guiMemoSetVerticalScrollPosition
- guiMemoIsReadOnly
- guiMemoSetCaretIndex
- guiMemoSetReadOnly
Progressbars
Radio Buttons
Scrollbars
Scrollpanes
- guiCreateScrollPane
- guiScrollPaneGetHorizontalScrollPosition
- guiScrollPaneGetVerticalScrollPosition
- guiScrollPaneSetHorizontalScrollPosition
- guiScrollPaneSetScrollBars
- guiScrollPaneSetVerticalScrollPosition
Static Images
Tab Panels
Tabs
Text Labels
- guiCreateLabel
- guiLabelGetColor
- guiLabelGetFontHeight
- guiLabelGetTextExtent
- guiLabelSetColor
- guiLabelSetHorizontalAlign
- guiLabelSetVerticalAlign