Re: Dialog button layout: including overlays

Mark Simon <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpfe
Message-ID <[email protected]>
On 22/03/13 11:05 am, Neil wrote:
> Mark Simon wrote:
>
>> I’m new to this group, so I apologise if this is the wrong forum.
>>
>> I am told
>> (https://developer.mozilla.org/en-US/docs/Code_snippets/Dialogs_and_Prompts)
>> that I can customise my own layout for dialog buttons, which I have
>> done as follows to include a checkbox:
>>
>>     <hbox id="okcancel">
>>         <checkbox id="copy" label="Copy" value="1" />
>>         <spacer flex="1"/>
>>         <button dlgtype="cancel"/>
>>         <button dlgtype="accept"/>
>>     </hbox>
>>
>> It works as expected, and, among other things, includes the checkbox
>> on the same row as the buttons.
>>
>> However, if move the code to a separate overlay file, and try to
>> include it as follows:
>>
>> <?xul-overlay href="chrome://htmltools/content/dialog/include.xul"?>
>> <hbox id="okcancel"/>
>>
>> it doesn’t work properly. The technique works for all other included
>> elements, but not this one. Depending on how I tweak things, I might
>> get additional vacant buttons, or buttons that don’t activate properly.
>>
>> Is there an extra or alternative step that I should use for this?
>
> Accessing XUL elements before the overlay has loaded (e.g. at the top
> level of a script rather than in an onload handler) has been known to
> cause this sort of behaviour.
>
That was it! It was the only element which I had assigned before the 
onload handler. Moving it fixed the assignment fixed it.

Thanks for your help.
_______________________________________________
dev-tech-xul mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xul
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.