[SVN] r5760
Brad Choate
brad at bradchoate.com
Mon Oct 30 06:49:59 UTC 2006
Of course, now I'm wondering how this will change to support nested
menus. Perhaps a menu item can have a 'menuItems' key/value pair also?
On Oct 30, 2006, at 3:46 AM, Allan Odgaard wrote:
> • new -u/--menu argument to tm_dialog which makes it interpret the
> paramaters property list as a menu structure, the structure is an
> array with the key menuItems and each item in the array is again a
> dictionary with either a title key/value pair or a separator key/
> value pair, so an example would be to call:
>
> tm_dialog -up '{ menuItems = ( { title = foo; }, { separator =
> 1; }, { title = bar; } ); }'
>
> This shows a menu with two items and a separator between these. It
> might seem a tad verbose, but a menu item can convey a lot of
> things (which we may want to support in the future).
>
> The result from tm_dialog is a dictionary with a selectedIndex key
> where the value is a zero-based index into the menuItems array, and
> a selectedMenuItem key with the selected item as value (so you can
> generally just store your user data in the structure you pass in.
> If there is no selection, an empty dictionary is returned —
> currently tm_dialog’s exit code is not affected by cancel (but
> probably should be).
>
> Changed:
> U trunk/Tools/Dialog PlugIn/Dialog.h
> U trunk/Tools/Dialog PlugIn/Dialog.mm
> U trunk/Tools/Dialog PlugIn/Dialog.xcodeproj/project.pbxproj
> U trunk/Tools/Dialog PlugIn/tm_dialog.mm
>
> _______________________________________________
> textmate-dev mailing list
> textmate-dev at lists.macromates.com
> http://lists.macromates.com/mailman/listinfo/textmate-dev
More information about the textmate-dev
mailing list