<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/DgsAddPropertyListener?action=history&amp;feed=atom</id>
	<title>DgsAddPropertyListener - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/DgsAddPropertyListener?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsAddPropertyListener&amp;action=history"/>
	<updated>2026-05-07T18:52:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DgsAddPropertyListener&amp;diff=82197&amp;oldid=prev</id>
		<title>Mohab at 04:17, 10 July 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsAddPropertyListener&amp;diff=82197&amp;oldid=prev"/>
		<updated>2025-07-10T04:17:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:17, 10 July 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l142&quot;&gt;Line 142:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 142:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;DGSFUNCTIONS&lt;/del&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;DGS General Functions&lt;/ins&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-82196:rev-82197 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mohab</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DgsAddPropertyListener&amp;diff=82196&amp;oldid=prev</id>
		<title>Mohab at 04:16, 10 July 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsAddPropertyListener&amp;diff=82196&amp;oldid=prev"/>
		<updated>2025-07-10T04:16:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:16, 10 July 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l142&quot;&gt;Line 142:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 142:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;_[[dgsRemovePropertyListener]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{DGSFUNCTIONS}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;_[[dgsGetListenedProperties]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;_[[dgsSetProperty]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;_[[dgsGetProperty]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:DGS_functions]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-82195:rev-82196 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mohab</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DgsAddPropertyListener&amp;diff=82195&amp;oldid=prev</id>
		<title>Mohab: Created page with &quot;{{client function}} __NOTOC__ This function enables monitoring of property changes on DGS elements. When a property that has been added to the listener list changes via dgsSetProperty, it triggers the onDgsPropertyChange event.  {{Note|Property listeners only trigger when using dgsSetProperty, not when using specific setter functions}} {{Note|The '''onDgsPropertyChange''' event is only triggered for properties that have been explicitly added to th...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsAddPropertyListener&amp;diff=82195&amp;oldid=prev"/>
		<updated>2025-07-10T04:14:39Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{client function}} __NOTOC__ This function enables monitoring of property changes on DGS elements. When a property that has been added to the listener list changes via &lt;a href=&quot;/wiki/DgsSetProperty&quot; title=&quot;DgsSetProperty&quot;&gt;dgsSetProperty&lt;/a&gt;, it triggers the &lt;a href=&quot;#Events&quot;&gt;onDgsPropertyChange&lt;/a&gt; event.  {{Note|Property listeners only trigger when using &lt;a href=&quot;/wiki/DgsSetProperty&quot; title=&quot;DgsSetProperty&quot;&gt;dgsSetProperty&lt;/a&gt;, not when using specific setter functions}} {{Note|The &amp;#039;&amp;#039;&amp;#039;&lt;a href=&quot;/wiki/OnDgsPropertyChange&quot; title=&quot;OnDgsPropertyChange&quot;&gt;onDgsPropertyChange&lt;/a&gt;&amp;#039;&amp;#039;&amp;#039; event is only triggered for properties that have been explicitly added to th...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function enables monitoring of property changes on DGS elements. When a property that has been added to the listener list changes via [[dgsSetProperty]], it triggers the [[#Events|onDgsPropertyChange]] event.&lt;br /&gt;
&lt;br /&gt;
{{Note|Property listeners only trigger when using [[dgsSetProperty]], not when using specific setter functions}}&lt;br /&gt;
{{Note|The '''[[onDgsPropertyChange]]''' event is only triggered for properties that have been explicitly added to the listener}}&lt;br /&gt;
{{Tip|Property listeners persist until explicitly removed using [[dgsRemovePropertyListener]] or the element is destroyed}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dgsAddPropertyListener ( element dgsElement, string/table propertyNames )&lt;br /&gt;
bool dgsAddPropertyListener ( table dgsElements, string/table propertyNames )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''dgsElement:''' A DGS element or table of DGS elements to monitor.&lt;br /&gt;
*'''propertyNames:''' A property name (string) or table of property names to listen for changes.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the property listener was added successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Example 1: Basic Property Monitoring===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
loadstring(exports.dgs:dgsImportFunction())()-- load functions&lt;br /&gt;
&lt;br /&gt;
-- Create a DGS window&lt;br /&gt;
local window = dgsCreateWindow(200, 200, 400, 300, &amp;quot;Property Monitor Demo&amp;quot;, false)&lt;br /&gt;
&lt;br /&gt;
-- Add listener for position changes&lt;br /&gt;
dgsAddPropertyListener(window, &amp;quot;absPos&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Set up event handler&lt;br /&gt;
addEventHandler(&amp;quot;onDgsPropertyChange&amp;quot;, window, function(propertyName, newValue, oldValue)&lt;br /&gt;
if propertyName == &amp;quot;absPos&amp;quot; then&lt;br /&gt;
outputChatBox(&amp;quot;Window moved from &amp;quot; .. tostring(oldValue[1]) .. &amp;quot;,&amp;quot; .. tostring(oldValue[2]) ..&lt;br /&gt;
&amp;quot; to &amp;quot; .. tostring(newValue[1]) .. &amp;quot;,&amp;quot; .. tostring(newValue[2]))&lt;br /&gt;
end&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
-- Test the listener&lt;br /&gt;
setTimer(function()&lt;br /&gt;
dgsSetProperty(window, &amp;quot;absPos&amp;quot;, {300, 250})&lt;br /&gt;
end, 2000, 1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 2: Multiple Property Monitoring===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
loadstring(exports.dgs:dgsImportFunction())()-- load functions&lt;br /&gt;
&lt;br /&gt;
-- Create a DGS button&lt;br /&gt;
local button = dgsCreateButton(50, 50, 200, 100, &amp;quot;Monitor Me&amp;quot;, false)&lt;br /&gt;
&lt;br /&gt;
-- Monitor multiple properties&lt;br /&gt;
dgsAddPropertyListener(button, {&amp;quot;text&amp;quot;, &amp;quot;color&amp;quot;, &amp;quot;size&amp;quot;})&lt;br /&gt;
&lt;br /&gt;
-- Handle property changes&lt;br /&gt;
addEventHandler(&amp;quot;onDgsPropertyChange&amp;quot;, button, function(propertyName, newValue, oldValue)&lt;br /&gt;
outputChatBox(&amp;quot;Property '&amp;quot; .. propertyName .. &amp;quot;' changed!&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if propertyName == &amp;quot;text&amp;quot; then&lt;br /&gt;
        outputChatBox(&amp;quot;Text changed from '&amp;quot; .. tostring(oldValue) .. &amp;quot;' to '&amp;quot; .. tostring(newValue) .. &amp;quot;'&amp;quot;)&lt;br /&gt;
    elseif propertyName == &amp;quot;color&amp;quot; then&lt;br /&gt;
        outputChatBox(&amp;quot;Color changed&amp;quot;)&lt;br /&gt;
    elseif propertyName == &amp;quot;size&amp;quot; then&lt;br /&gt;
        outputChatBox(&amp;quot;Size changed to &amp;quot; .. tostring(newValue[1]) .. &amp;quot;x&amp;quot; .. tostring(newValue[2]))&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
-- Test the listeners&lt;br /&gt;
setTimer(function()&lt;br /&gt;
dgsSetProperty(button, &amp;quot;text&amp;quot;, &amp;quot;Changed Text!&amp;quot;)&lt;br /&gt;
end, 1000, 1)&lt;br /&gt;
&lt;br /&gt;
setTimer(function()&lt;br /&gt;
dgsSetProperty(button, &amp;quot;color&amp;quot;, {tocolor(255, 0, 0, 255), tocolor(200, 0, 0, 255), tocolor(150, 0, 0, 255)})&lt;br /&gt;
end, 2000, 1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 3: Monitoring Multiple Elements===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
loadstring(exports.dgs:dgsImportFunction())()-- load functions&lt;br /&gt;
&lt;br /&gt;
-- Create multiple elements&lt;br /&gt;
local elements = {}&lt;br /&gt;
elements[1] = dgsCreateButton(100, 100, 150, 50, &amp;quot;Button 1&amp;quot;, false)&lt;br /&gt;
elements[2] = dgsCreateButton(100, 200, 150, 50, &amp;quot;Button 2&amp;quot;, false)&lt;br /&gt;
elements[3] = dgsCreateButton(100, 300, 150, 50, &amp;quot;Button 3&amp;quot;, false)&lt;br /&gt;
&lt;br /&gt;
-- Add property listeners to all elements at once&lt;br /&gt;
dgsAddPropertyListener(elements, &amp;quot;visible&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Handle visibility changes for all elements&lt;br /&gt;
for i, element in ipairs(elements) do&lt;br /&gt;
addEventHandler(&amp;quot;onDgsPropertyChange&amp;quot;, element, function(propertyName, newValue, oldValue)&lt;br /&gt;
if propertyName == &amp;quot;visible&amp;quot; then&lt;br /&gt;
local elementName = &amp;quot;Element &amp;quot; .. i&lt;br /&gt;
outputChatBox(elementName .. &amp;quot; visibility changed to &amp;quot; .. tostring(newValue))&lt;br /&gt;
end&lt;br /&gt;
end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Test visibility changes&lt;br /&gt;
setTimer(function()&lt;br /&gt;
for i, element in ipairs(elements) do&lt;br /&gt;
dgsSetProperty(element, &amp;quot;visible&amp;quot;, math.random() &amp;gt; 0.5)&lt;br /&gt;
end&lt;br /&gt;
end, 3000, 1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 4: Real-time Position Tracking===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
loadstring(exports.dgs:dgsImportFunction())()-- load functions&lt;br /&gt;
&lt;br /&gt;
-- Create a movable window&lt;br /&gt;
local trackingWindow = dgsCreateWindow(100, 100, 250, 200, &amp;quot;Position Tracker&amp;quot;, false)&lt;br /&gt;
local positionLabel = dgsCreateLabel(10, 30, 230, 20, &amp;quot;Position: 100, 100&amp;quot;, false, trackingWindow)&lt;br /&gt;
local sizeLabel = dgsCreateLabel(10, 60, 230, 20, &amp;quot;Size: 250 x 200&amp;quot;, false, trackingWindow)&lt;br /&gt;
&lt;br /&gt;
-- Monitor position and size changes&lt;br /&gt;
dgsAddPropertyListener(trackingWindow, {&amp;quot;absPos&amp;quot;, &amp;quot;absSize&amp;quot;})&lt;br /&gt;
&lt;br /&gt;
-- Update labels when properties change&lt;br /&gt;
addEventHandler(&amp;quot;onDgsPropertyChange&amp;quot;, trackingWindow, function(propertyName, newValue, oldValue)&lt;br /&gt;
if propertyName == &amp;quot;absPos&amp;quot; then&lt;br /&gt;
dgsSetProperty(positionLabel, &amp;quot;text&amp;quot;, &amp;quot;Position: &amp;quot; .. newValue[1] .. &amp;quot;, &amp;quot; .. newValue[2])&lt;br /&gt;
elseif propertyName == &amp;quot;absSize&amp;quot; then&lt;br /&gt;
dgsSetProperty(sizeLabel, &amp;quot;text&amp;quot;, &amp;quot;Size: &amp;quot; .. newValue[1] .. &amp;quot; x &amp;quot; .. newValue[2])&lt;br /&gt;
end&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
-- Make window movable and resizable for testing&lt;br /&gt;
dgsSetProperty(trackingWindow, &amp;quot;movable&amp;quot;, true)&lt;br /&gt;
dgsSetProperty(trackingWindow, &amp;quot;sizable&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Author==&lt;br /&gt;
[[User:Mohab|Mohab]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
_[[dgsRemovePropertyListener]]&lt;br /&gt;
_[[dgsGetListenedProperties]]&lt;br /&gt;
_[[dgsSetProperty]]&lt;br /&gt;
_[[dgsGetProperty]]&lt;br /&gt;
&lt;br /&gt;
[[Category:DGS_functions]]&lt;/div&gt;</summary>
		<author><name>Mohab</name></author>
	</entry>
</feed>