Making a pop-up menu reflect a preference, even the default value

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Making a pop-up menu reflect a preference, even the default value

Henri Sivonen-2
I'm trying to make a pop-up menu that reflects a preference.  One case
doesn't work though: When the menu is shown and the value of the
preference is at the default value, the  pop-up menu shows an empty
time instead of initializing to the default item being the one shown.

If the preference is set to a non-default value whether by the menu
itself previously or via about:config, the menu is properly
initialized to show the item that reflects the non-default preference
value.

What do I need to do to make the default case work?

The code I have looks like this:

      <preference id="intl.charset.fallback.override"
name="intl.charset.fallback.override" type="wstring"/>

...

        <menulist id="DefaultCharsetList"
preference="intl.charset.fallback.override">
          <menupopup>
            <menuitem label="&languages.customize.Fallback.auto;"
  value="auto"/>
            <menuitem label="&languages.customize.Fallback.arabic;"
  value="windows-1256"/>
            <menuitem label="&languages.customize.Fallback.baltic;"
  value="windows-1257"/>
            <menuitem label="&languages.customize.Fallback.ceiso;"
  value="ISO-8859-2"/>
            <menuitem label="&languages.customize.Fallback.cewindows;"
  value="windows-1250"/>
            <menuitem
label="&languages.customize.Fallback.simplified;"  value="gbk"/>
            <menuitem
label="&languages.customize.Fallback.traditional;" value="Big5"/>
            <menuitem label="&languages.customize.Fallback.cyrillic;"
  value="windows-1251"/>
            <menuitem label="&languages.customize.Fallback.greek;"
  value="ISO-8859-7"/>
            <menuitem label="&languages.customize.Fallback.hebrew;"
  value="windows-1255"/>
            <menuitem label="&languages.customize.Fallback.japanese;"
  value="Shift_JIS"/>
            <menuitem label="&languages.customize.Fallback.korean;"
  value="EUC-KR"/>
            <menuitem label="&languages.customize.Fallback.thai;"
  value="windows-874"/>
            <menuitem label="&languages.customize.Fallback.turkish;"
  value="windows-1254"/>
            <menuitem
label="&languages.customize.Fallback.vietnamese;"
value="windows-1258"/>
            <menuitem label="&languages.customize.Fallback.other;"
  value="windows-1252"/>
          </menupopup>
        </menulist>


--
Henri Sivonen
[hidden email]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Making a pop-up menu reflect a preference, even the default value

Neil-4
Henri Sivonen wrote:

>      <preference id="intl.charset.fallback.override" name="intl.charset.fallback.override" type="wstring"/>
>
wstring is a localised string, if your preference is a simple string
then just use string.

--
Warning: May contain traces of nuts.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Making a pop-up menu reflect a preference, even the default value

Henri Sivonen-2
On Thu, Sep 19, 2013 at 1:00 AM, Neil <[hidden email]> wrote:
> Henri Sivonen wrote:
>
>>      <preference id="intl.charset.fallback.override"
>> name="intl.charset.fallback.override" type="wstring"/>
>>
> wstring is a localised string, if your preference is a simple string then
> just use string.

That worked. Thank you.

--
Henri Sivonen
[hidden email]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul