From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../zh-cn/mozilla/tech/xul/broadcaster/index.html | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 files/zh-cn/mozilla/tech/xul/broadcaster/index.html (limited to 'files/zh-cn/mozilla/tech/xul/broadcaster/index.html') diff --git a/files/zh-cn/mozilla/tech/xul/broadcaster/index.html b/files/zh-cn/mozilla/tech/xul/broadcaster/index.html new file mode 100644 index 0000000000..be97efef42 --- /dev/null +++ b/files/zh-cn/mozilla/tech/xul/broadcaster/index.html @@ -0,0 +1,91 @@ +--- +title: broadcaster +slug: Mozilla/Tech/XUL/broadcaster +translation_of: Archive/Mozilla/XUL/broadcaster +--- +
+ + « XUL Reference home [ + 示例 | + 属性 | + 特性 | + 方法 | + 相关 ] +
+
+
+ 当您希望若干个元素共享一个或多个属性值时,或者当您想要多个元素对某一个状态改变做出响应是,可以使用 broadcaster。任何监视 broadcaster 的元素都会共享到 broadcaster 中的属性。比如说,假设我们有一个 broadcaster,它拥有一个 label 属性,而它的观察者们正在监视这个 label。这时如果 label 发生了改变,label 的观察者们将立刻被唤醒(update)。改变发生时,每个观察者都会收到一个 onbroadcast 事件。
+
+ 对于 menuitem 或者 button 来说,如果只是为了根据功能是否可用,即时更新菜单项目的 disabled 状态,那么您应该优先考虑 command
+

更多内容请参考 Broadcasters and Observers XUL Tutorial.

+

Examples

+

(example needed)

+

Attributes

+

+ + + + + +

Inherited from XUL element
+align, +allowevents, +allownegativeassertions, +class, +coalesceduplicatearcs, +collapsed, +container, +containment, +context, +contextmenu, +datasources, +dir, +empty, +equalsize, +flags, +flex, +height, +hidden, +id, +insertafter, +insertbefore, +left, +maxheight, +maxwidth, +menu, +minheight, +minwidth, +mousethrough, +observes, +ordinal, +orient, +pack, +persist, +popup, +position, +preference-editable, +querytype, +ref, +removeelement, +sortDirection, +sortResource, +sortResource2, +statustext, +style, +template, +tooltip, +tooltiptext, +top, +uri, +wait-cursor, +width

+

+

Properties

+

+

Inherited Properties
align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width

+

Methods

+

+

Inherited from XUL element
blur, click, doCommand, focus, getElementsByAttribute

Inherited from DOM element
addEventListener(), appendChild(), dispatchEvent(), getAttribute(), getAttributeNode(), getAttributeNodeNS(), getAttributeNS(), getElementsByTagName(), getElementsByTagNameNS(), hasAttribute(), hasAttributeNS(), hasAttributes(), hasChildNodes(), insertBefore(), isSupported(), normalize(), removeAttribute(), removeAttributeNode(), removeAttributeNS(), removeChild(), removeEventListener(), replaceChild(), setAttribute(), setAttributeNode(), setAttributeNodeNS(), setAttributeNS()

+ +

TBD

+

-- cgit v1.2.3-54-g00ecf