Add a new Dialog class to exploit the async window options in tm_dialog. You 
can interact with dialogs on the fly by updating their parameter bindings 
(contrived example):

Dialog.dialog('NetworkAssimilator.nib', parameters) do |dialog|
  dialog.wait_for_input do |params|
    if params['disableNetworkAccess'] == true
      dialog.parameters = {'hideNetworkButton' => true}
    else
      dialog.parameters = {'hideNetworkButton' => false,
                                 'exampleText' => 'network wins again!'}
    end
  end
end

It would be possible to make this code slightly easier to write, with some 
judicious use of method_missing, but I haven't implemented it yet:

    dialog.parameters.hide_network_button = 'Complete!'

(Less efficient for updates of multiple parameters, of course, but you're not 
likely to notice the difference.)

Changed:
U   trunk/Support/lib/dialog.rb

_______________________________________________
textmate-dev mailing list
[email protected]
http://lists.macromates.com/mailman/listinfo/textmate-dev

Reply via email to