• major changes Using the window command follow this form:
1. Load the nib: "$DIALOG" window --load «path» # returns token 2. Wait for an ‘event’ (see below): "$DIALOG" window --wait «token» 3. Potentially update the model: "$DIALOG" window --update «token» --model «plist» 4. Close the window: "$DIALOG" window --close «token» There is no longer support for the previous “show” action (which was sort of a --load, --wait, and --close) and no longer support for modal dialogs (see below). # Event Info When using --wait a property list is returned which has two keys, one is ‘eventInfo’ and the other is ‘model’. The latter returns the state of the model (previously called parameters, and presumably a mutated version of what got passed in via --model). The former describes the event that caused --wait to return. It is a dictionary with at least one key (‘type’), presently 3 event types are defined: buttonClick, closeWindow, and bindingAction. At least one more is planned (observing a key path for changes). # No Modal Dialogs I removed the support for this because it was initially added to make things easier for the (bundle) programmer related to how commands are executed under TextMate 1.x. Running a window in modal mode starts a local event loop. While TextMate runs commands, it is running its own event loop. These things are hairy, and modal dialogs should be chosen because they make sense from a UI perspective, not because of current implementation problems. They _might_ be back, but not until TM 2.0 (so until then, just stay with Dialog 1.x if you really need this). # Other Options Some other options are: --prototypes (previously this was called --new-values), --center, and --defaults (previously called --initial-settings or similar). # Future Plans Presently --wait returns a full property list, there will likely be a --filter «key path» option to return just that key path. There will also be an --observe option as discussed on the mailing list (to observe a key path for changes, allowing actions to happen (--wait to break) e.g. when changing a pop-up menu or similar which does not trigger a real action (method call)). Changed: U branches/WIP/Tools/Dialog2/Commands/Utilities/TMDNibController.h U branches/WIP/Tools/Dialog2/Commands/Utilities/TMDNibController.mm U branches/WIP/Tools/Dialog2/Commands/window.mm _______________________________________________ textmate-dev mailing list [email protected] http://lists.macromates.com/listinfo/textmate-dev
