<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://library.morph.zone/index.php?action=history&amp;feed=atom&amp;title=Wyszukiwanie_obiekt%C3%B3w_w_drzewie</id>
		<title>Wyszukiwanie obiektów w drzewie - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://library.morph.zone/index.php?action=history&amp;feed=atom&amp;title=Wyszukiwanie_obiekt%C3%B3w_w_drzewie"/>
		<link rel="alternate" type="text/html" href="https://library.morph.zone/index.php?title=Wyszukiwanie_obiekt%C3%B3w_w_drzewie&amp;action=history"/>
		<updated>2026-05-12T04:46:13Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://library.morph.zone/index.php?title=Wyszukiwanie_obiekt%C3%B3w_w_drzewie&amp;diff=1244&amp;oldid=prev</id>
		<title>Krashan: Translation finished.</title>
		<link rel="alternate" type="text/html" href="https://library.morph.zone/index.php?title=Wyszukiwanie_obiekt%C3%B3w_w_drzewie&amp;diff=1244&amp;oldid=prev"/>
				<updated>2011-01-29T13:54:38Z</updated>
		
		<summary type="html">&lt;p&gt;Translation finished.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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 style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:54, 29 January 2011&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-l4&quot; &gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;After the complete object tree is created&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;there is no direct access to any object except the main &lt;/del&gt;''Application'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;object&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;A way to access other objects is needed. There are a few ways to do this&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Po stworzeniu kompletnego drzewa obiektów&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;nie ma bezpośredniego dostępu do żadnego z nich, oprócz obiektu głównego, klasy &lt;/ins&gt;''Application''. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Jakiś dostęp jednak jest potrzebny, można go uzyskać na trzy sposoby&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Storing pointers to objects in global variables&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;This is the simplest way and may work well in simple projects&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The disadvantage is it breaks object oriented design principles &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;like data encapsulation&lt;/del&gt;) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;and creates a mess when the number of global variables reaches &lt;/del&gt;50, 100 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;or more&lt;/del&gt;. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Wskaźniki do obiektów jako zmienne globalne&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;To najprostszy sposób, może się sprawdzać w małych projektach&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Jego wadą jest naruszanie zasad projektowania obiektowego &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;np. zasady enkapsulacji danych&lt;/ins&gt;) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;i bałagan jaki się tworzy gdy liczba zmiennych globalnych osiąga &lt;/ins&gt;50, 100 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;i więcej&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Store pointers in fields of some subclass instance data &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;for example the ''Application'' instance&lt;/del&gt;). &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;A good idea&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;but a bit tedious to implement&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;An object&lt;/del&gt;'&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;s instance data area does not exist until the object is fully created and the &lt;/del&gt;''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Application&lt;/del&gt;'&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;' object is created as the last one&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Then pointers to subobjects have to be stored in some temporary variables&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;This technique also requires that a parent object of the cached one is an instance of a custom &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;subclassed&lt;/del&gt;) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;class and the parent creates its subobjects inside the constructor&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;which is not always true&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Przechowywanie wskaźników do obiektów w polach obszaru danych jakiegoś obiektu &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;na przykład obiektu aplikacji&lt;/ins&gt;). &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;To dobry pomysł&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ale problematyczny w implementacji&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Obszar danych obiektu istnieje dopiero po jego stworzeniu (dokładniej - po wykonaniu konstruktora w klasie &lt;/ins&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;rootclass&lt;/ins&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;), a obiekt aplikacji jest tworzony jako ostatni&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Wskaźniki do obiektów potomnych musiałyby być przechowywane w jakichś zmiennych tymczasowych&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Ta technika zakłada również, że obiekt nadrzędny wobec tego, do którego potrzebny jest dostęp, jest obiektem jakiejś klasy niestandardowej &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;z przeciążonym konstruktorem&lt;/ins&gt;)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Oprócz tego zakłada&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;że obiekt nadrzędny tworzy nasz poszukiwany w tymże konstruktorze, co nie zawsze musi być prawdą&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Use the &lt;/del&gt;''MUIA_UserData'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;attribute and the &lt;/del&gt;''MUIM_FindUData()'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;method to find objects dynamically&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;This is the best solution when objects are accessed rarely &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;for example once&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;just to set notifications&lt;/del&gt;). &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;For frequently accessed objects &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;let's say several times a second&lt;/del&gt;) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;it may be combined with caching objects' pointers in an instance data of some subclassed object&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Użycie atrybutu &lt;/ins&gt;''MUIA_UserData'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;i metody &lt;/ins&gt;''MUIM_FindUData()'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;w celu dynamicznego wyszukiwania obiektów&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;To najlepsze rozwiązanie, gdy dostęp do obiektów potrzebny jest nie za często &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;na przkład tylko raz, w celu ustawienia [[Programowanie sterowane zdarzeniami&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;notyfikacje#Notyfikacje w MUI|notyfikacji]]&lt;/ins&gt;). &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Jeżeli dostęp zachodzi często &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;powiedzmy kilka razy na sekundę i częściej&lt;/ins&gt;) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;można tę technikę połączyć z przechowywaniem wskaźników w obiekcie nadrzędnym&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;The last approach works as follows&lt;/del&gt;: &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;every object to be searched has the &lt;/del&gt;''MUIA_UserData'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;attribute set to some predefined unique value&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Then at any time the object may be found by this value using the &lt;/del&gt;''MUIM_FindUData()'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;method on a direct or indirect parent object&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;for example on the master ''Application'' object&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Wyszukiwanie dynamiczne działa następująco&lt;/ins&gt;: &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;każdy obiekt, jaki będzie później wyszukiwany, ma atrybut &lt;/ins&gt;''MUIA_UserData'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ustawiony na określoną, unikalną wartość&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Następnie w dowolnym momencie można uzyskać wskaźnik do tego obiektu wywołując metodę &lt;/ins&gt;''MUIM_FindUData()'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;na jego obiekcie (bezpośrednio lub pośrednio) nadrzędnym, na przykład na obiekcie aplikacji&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;który jest nadrzędny dla wszystkich innych&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; #define &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;OBJ_SOME_BUTTON &lt;/del&gt;36&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; #define &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;OBJ_JAKIS_PRZYCISK &lt;/ins&gt;36&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; /* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Somewhere in the initial tags for the button &lt;/del&gt;*/&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; /* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Gdzieś w wartościach początkowych dla atrybutów obiektu &lt;/ins&gt;*/&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; MUIA_UserData, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;OBJ_SOME_BUTTON&lt;/del&gt;,&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; MUIA_UserData, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;OBJ_JAKIS_PRZYCISK&lt;/ins&gt;,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; /* ... */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; /* ... */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; /* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Let's get the pointer to the button now &lt;/del&gt;*/&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; /* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Chcemy uzyskać wskaźnik do obiektu &lt;/ins&gt;*/&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; Object *&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;some_button&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; Object *&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;jakis_przycisk&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;some_button &lt;/del&gt;= (Object*)DoMethod(App, MUIM_FindUData, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;OBJ_SOME_BUTTON&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;jakis_przycisk &lt;/ins&gt;= (Object*)DoMethod(App, MUIM_FindUData, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;OBJ_JAKIS_PRZYCISK&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;This operation is so common that it is usually encapsulated in a macro&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Ponieważ to bardzo często wykonywana operacja, wygodnie jest opakować ją w makro&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; #define findobj(id, parent) (Object*)DoMethod(parent, MUIM_FindUData, id)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; #define findobj(id, parent) (Object*)DoMethod(parent, MUIM_FindUData, id)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;some_button &lt;/del&gt;= findobj(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;OBJ_SOME_BUTTON&lt;/del&gt;, App);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;jakis_przycisk &lt;/ins&gt;= findobj(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;OBJ_JAKIS_PRZYCISK&lt;/ins&gt;, App);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;The macro may of course be used directly in other functions&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;like in this example changing the button label&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Makro można oczywiście bezpośrednio wywoływać w innych funkcjach&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;na przykład przy zmianie atrybutów, albo w notyfikacjach. Oto przykład zmieniający tekst przycisku&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; set(findobj(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;OBJ_SOME_BUTTON&lt;/del&gt;, App), MUIA_Text_Contents, &amp;quot;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Press Me&lt;/del&gt;&amp;quot;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160; set(findobj(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;OBJ_JAKIS_PRZYCISK&lt;/ins&gt;, App), MUIA_Text_Contents, &amp;quot;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Kliknij&lt;/ins&gt;&amp;quot;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Note that the &lt;/del&gt;''findobj()'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;macro is not defined in the system &lt;/del&gt;MUI &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;headers&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;so it should be defined in the application code&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Trzeba zauważyć, że makro &lt;/ins&gt;''findobj()'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;nie jest zdefiniowane w systemowych plikach nagłówkowych &lt;/ins&gt;MUI, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;trzeba je zdefiniować samodzielnie w kodzie programu&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Krashan</name></author>	</entry>

	<entry>
		<id>https://library.morph.zone/index.php?title=Wyszukiwanie_obiekt%C3%B3w_w_drzewie&amp;diff=1243&amp;oldid=prev</id>
		<title>Krashan: Polish translation started.</title>
		<link rel="alternate" type="text/html" href="https://library.morph.zone/index.php?title=Wyszukiwanie_obiekt%C3%B3w_w_drzewie&amp;diff=1243&amp;oldid=prev"/>
				<updated>2011-01-29T13:20:14Z</updated>
		
		<summary type="html">&lt;p&gt;Polish translation started.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;''Grzegorz Kraszewski''&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;small&amp;gt;Ten artykuł w innych językach: [[Locating Objects in the Object Tree|angielski]]&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After the complete object tree is created, there is no direct access to any object except the main ''Application'' object. A way to access other objects is needed. There are a few ways to do this:&lt;br /&gt;
* Storing pointers to objects in global variables. This is the simplest way and may work well in simple projects. The disadvantage is it breaks object oriented design principles (like data encapsulation) and creates a mess when the number of global variables reaches 50, 100 or more. &lt;br /&gt;
* Store pointers in fields of some subclass instance data (for example the ''Application'' instance). A good idea, but a bit tedious to implement. An object's instance data area does not exist until the object is fully created and the ''Application'' object is created as the last one. Then pointers to subobjects have to be stored in some temporary variables. This technique also requires that a parent object of the cached one is an instance of a custom (subclassed) class and the parent creates its subobjects inside the constructor, which is not always true.&lt;br /&gt;
* Use the ''MUIA_UserData'' attribute and the ''MUIM_FindUData()'' method to find objects dynamically. This is the best solution when objects are accessed rarely (for example once, just to set notifications). For frequently accessed objects (let's say several times a second) it may be combined with caching objects' pointers in an instance data of some subclassed object.&lt;br /&gt;
The last approach works as follows: every object to be searched has the ''MUIA_UserData'' attribute set to some predefined unique value. Then at any time the object may be found by this value using the ''MUIM_FindUData()'' method on a direct or indirect parent object, for example on the master ''Application'' object.&lt;br /&gt;
&lt;br /&gt;
 #define OBJ_SOME_BUTTON 36&lt;br /&gt;
 &lt;br /&gt;
 /* Somewhere in the initial tags for the button */&lt;br /&gt;
 MUIA_UserData, OBJ_SOME_BUTTON,&lt;br /&gt;
 /* ... */&lt;br /&gt;
 &lt;br /&gt;
 /* Let's get the pointer to the button now */&lt;br /&gt;
 &lt;br /&gt;
 Object *some_button;&lt;br /&gt;
 &lt;br /&gt;
 some_button = (Object*)DoMethod(App, MUIM_FindUData, OBJ_SOME_BUTTON);&lt;br /&gt;
&lt;br /&gt;
This operation is so common that it is usually encapsulated in a macro:&lt;br /&gt;
&lt;br /&gt;
 #define findobj(id, parent) (Object*)DoMethod(parent, MUIM_FindUData, id)&lt;br /&gt;
 &lt;br /&gt;
 some_button = findobj(OBJ_SOME_BUTTON, App);&lt;br /&gt;
&lt;br /&gt;
The macro may of course be used directly in other functions, like in this example changing the button label:&lt;br /&gt;
&lt;br /&gt;
 set(findobj(OBJ_SOME_BUTTON, App), MUIA_Text_Contents, &amp;quot;Press Me&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Note that the ''findobj()'' macro is not defined in the system MUI headers, so it should be defined in the application code.&lt;/div&gt;</summary>
		<author><name>Krashan</name></author>	</entry>

	</feed>