DgsGetChildren

From Multi Theft Auto: Wiki

This function returns all of the child dgs elements of a given parent dgs element.

Syntax

element dgsGetChildren ( element dgsParent ) 

Required Arguments

  • dgsParent: the dgs element above the one to be returned in the hierarchy.

Returns

Returns a table includes the child dgs elements of the parent, or false if it doesn't.

Example

DGS = exports.dgs

parent = DGS:dgsCreateWindow(200,100,400,400,"DGS Parent Window",false)	--Create a window
child1 = DGS:dgsCreateLabel(10,0,380,20,"",false,parent)	--Create child 1
child2 = DGS:dgsCreateLabel(10,20,380,20,"",false,parent)	--Create child 2
child3 = DGS:dgsCreateLabel(10,40,380,20,"",false,parent)	--Create child 3
child4 = DGS:dgsCreateLabel(10,60,380,20,"",false,parent)	--Create child 4

--Set a random number to all child dgs elements.
setTimer(function()
	local children = DGS:dgsGetChildren(parent)
	for id,child in ipairs(children) do
		DGS:dgsSetText(child,math.random(1,100))
	end
end,1000,0)

See Also

Multi Language Supports

Animation

3D Interface

3D Text

Arrow List

Browser

Button

Check Box

Combo Box

Edit

Ellipse Detect Area

Detect Area

Grid List

Image

Memo

Label

Progress Bar

Radio Button

Scroll Bar

Scroll Pane

Switch Button

Tab Panel

Window

Plugin

Media Browser

Rounded Rectangle

Color Picker

Blur Box

Effect 3D