Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dialog button layout: including overlays

7 views
Skip to first unread message

Mark Simon

unread,
Mar 20, 2013, 8:19:25 PM3/20/13
to
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?

Thanks

Neil

unread,
Mar 21, 2013, 8:05:19 PM3/21/13
to
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.

--
Warning: May contain traces of nuts.

Mark Simon

unread,
Mar 23, 2013, 10:25:05 PM3/23/13
to
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.
0 new messages