[TxMt Plugins] Dialog API improvements
Hans-Jörg Bibiko
bibiko at eva.mpg.de
Fri Sep 21 08:59:00 UTC 2007
On 21.09.2007, at 09:21, Hans-Jörg Bibiko wrote:
> NEW:
> -s, --show <InlineMenu,OpenPanel {<accessory view
> nib>},RequestString,Alert,MyNIB,HTMLToolTip,InteractivePopUp...> =>
> sync
> -i, --init <nib_file> => async
>
> -c, --center
> -d, --defaults <plist>
> -n, --new-items <plist>
> -m, --modal
> -p, --parameters <plist>
> -q, --quiet
>
> -l, --list-windows <token>
> -r, --refresh-window <token>
> -k, --kill-window <token>
> -w, --wait-for-input <token>
>
Furthermore one could set not only $DIALOG but also the following
variables in order to abbreviate common used commands:
$DILAOG_SHOWNIB nib plist => tm_dialog -m -s $1 -p $2
$DIALOG_INITNIB nib plist => tm_dialog -i $1 -p $2
$DIALOG_SHOWPANEL panel {nib} plist => tm_dialog -s $1 (argc==3)?
$2:"" -p (argc==3)?$3:$2
...
and I forgot the option -h for help. This option would open a pdf/
html/man... file showing a complete manual with examples for tm_dialog.
Chris' suggestion with:
- (void)dispatchCommandLine:(NSArray *)commandLineItems{}
is a very flexible approach and has many advantages.
The question is: What will the future bring us? As far as I
understood the philosophy of tm_dialog it is a tool to provide the
user 'only' with several kinds of dialog windows. There are some
things which are in my mind and worth to be added to tm_dialog, e.g.
to place the window to given origin point or place it under the
caret's position, to change some attributes of the window or of nib
components in respect of appearance, fading, resizing etc. but all
these things can be specified within the PLIST. This would also mean
that options like '-c' and '-q' could be set within the PLIST if one
understand the PLIST as parameters which control the content AND the
appearance of the given nib.
Other commands like Play a self-defined macro, or Execute a batch of
bundle macros, snippets, commands, templates, etc. belongs to an
other plug-in.
By my opinion: Keep things simple as possible.
--Hans
PS:
On totally other approach I read in the internet is to specify the
behaviour of the nib within the nib as hidden Switches, Radio
Buttons, etc.. That would mean you have Radio Buttons for Sync and
Async; Switches for quiet, modal, and centered etc. These have a
default and can be overwritten. But I believe this is not adoptable
to tm_dialog.
More information about the textmate-plugins
mailing list