SeaMonkey:Toolkit Transition:PrefwindowPanes:HowTo: Difference between revisions

(clarification)
Line 66: Line 66:
  // <prefpane id="navigator_pane">!
  // <prefpane id="navigator_pane">!


==== 3. Preferences ====
====Preferences====
Preferences handling required some complicated hack-arounds, this has changed.
Preferences handling required some complicated hack-arounds, this has changed.


Line 100: Line 100:
     </preferences>
     </preferences>


The <preferences> element must be a direct child of the <prefpane>, with the <preference>s as its children. (Usually, it should be the '''last''' child of the <prefpane>, so that the <preference>'s constructor can init any elements watching this pref.) Each <preference> needs the attributes ''name'' (with the name of the preference in ''prefs.js'' etc.) and ''type'' with its type, see [http://developer.mozilla.org/en/docs/Preferences_System:preference DevMo for details]. Since preference names are unique by default, the ''id'' attribute should be set to the pref name as well.
The <preferences> element must be a direct child of the <prefpane>, with the <preference>s as its children. (Usually, it's the first child of the <prefpane>, so that the <preference>'s constructor can init any elements watching this pref. Note the order of initialization code below, though.) Each <preference> needs the attributes ''name'' (with the name of the preference in ''prefs.js'' etc.) and ''type'' with its type, see [http://developer.mozilla.org/en/docs/Preferences_System:preference DevMo for details]. Since preference names are unique by default, the ''id'' attribute should be set to the pref name as well.


The former ''prefstring'' attribute on an element must be replaced by a ''preference'' attribute, which contains the ''id'' of the respective <preference>.
The former ''prefstring'' attribute on an element must be replaced by a ''preference'' attribute, which contains the ''id'' of the respective <preference>.


All reading/writing of preferences is handled by the backend, there is usally no need to instantiate preference interface/service!
All reading/writing of preferences is handled by the backend, there is usally no need to instantiate preference interface/service!
====Call Order for Initialization Code====


<div style="font-size:smaller; direction: rtl;">''Page maintained by [mailto:mnyromyr@tprac.de Karsten Düsterloh]''</div>
<div style="font-size:smaller; direction: rtl;">''Page maintained by [mailto:mnyromyr@tprac.de Karsten Düsterloh]''</div>
235

edits