Closed Bug 589057 Opened 14 years ago Closed 14 years ago

Document the window-utils module

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adw, Assigned: adw)

References

Details

Attachments

(1 file, 2 obsolete files)

Attached patch patch (obsolete) — Splinter Review
There've been several people on the mailing list wondering about how to use window-utils, so let's document it.
Attachment #467676 - Flags: review?(avarma)
Blocks: 563284
Comment on attachment 467676 [details] [diff] [review]
patch

This looks great, but one thing that should be mentioned is that the tracker delegate's onUntrack() is also called on all open windows when the tracker itself is unloaded--which is either when its containing addon is disabled/uninstalled, or when its unload() method is called, whichever comes first.

In other words, it's not the case that onUntrack() is *only* called when a window is closed, but the documentation seems to imply this.

Does that make sense?
Attachment #467676 - Flags: review?(avarma) → review-
Attached patch patch v2 (obsolete) — Splinter Review
Thanks Atul, I forgot about that case.  How's this?
Assignee: nobody → adw
Attachment #467676 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #468535 - Flags: review?(avarma)
Comment on attachment 468535 [details] [diff] [review]
patch v2

Cool! Only nit now is that the example onUntrack() handler logs a console message of "A window was closed", which conflicts w/ the docs and is a bit misleading...

Also, just as a nit, you may want to mention the intended use case of the class, which is that it was meant as a tool to make it easy to "monkeypatch" a window when an addon is loaded, e.g. by adding a status bar icon or some other thing, and "un-monkeypatch" the window when the addon is disabled/uninstalled. Adding that context might help the reader understand the otherwise surprisingly-complex semantics of the object's behavior.
Attachment #468535 - Flags: review?(avarma) → review+
Attached patch patch v2Splinter Review
Good points, thanks.  Still not entirely happy with my writing, but it'll do I guess.
Attachment #468535 - Attachment is obsolete: true
http://hg.mozilla.org/labs/jetpack-sdk/rev/fd065f7b5bb6
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product.

To filter bugmail related to this change, filter on the word "looptid".
Component: Jetpack SDK → General
Product: Mozilla Labs → Add-on SDK
QA Contact: jetpack-sdk → general
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: