[TxMt] Re: basic dialog in ruby

Piero D'Ancona pierodancona at gmail.com
Fri Mar 2 17:32:32 UTC 2007


Charilaos Skiadas <skiadas at ...> writes:

> #!/usr/bin/env ruby
> require ENV["TM_SUPPORT_PATH"] + "/lib/dialog.rb"
> str = "hi there"
> newstr = Dialog.request_string(:title => "Change me!", :prompt  =>  
> "Please change me:", :default => str)
> if newstr.nil?
> 	print "You pressed Cancel!"
> else
> 	print "Here's the new string: #{newstr}"
> end

Amazing (and so simple).
Thanks Haris!

Piero




More information about the textmate mailing list