From: 12 34 Date: 2007-07-29T08:40:33+09:00 Subject: Re: Best OS-X GUI creator for non-programmer John Joyce wrote: > On Jul 28, 2007, at 5:11 PM, 12 34 wrote: > >> >> OK found it. CocoaDialog. >> And it can be used directly from Ruby. >> -- >> Posted via http://www.ruby-forum.com/. >> > Cool, let me know how it goes with that! I myself would like to try > using it in the near future. http://cocoadialog.sourceforge.net/ The download is one file, a Mac application which I put in my Utilities folder Here's a cleaned up testing script I put together from the Perl examples (TextMate just crashed on me and now won't run scripts, so I hope this script is all good. I was doing some final polishing before posting.): #!/usr/bin/env ruby # The Perl script seemed to have a path to the file, but # Ruby / OS X seems to have found it without any help. response = `CocoaDialog yesno-msgbox --title "Delete backups--test 1" --text "Delete all the backups?" --informative-text "This cannot be un-done"` puts "Delete backups--test 1" puts response response2 =`CocoaDialog inputbox --title "Search--Test 2" --no-newline --informative-text "Enter your search term" --text "foobar" --button1 "Search" --button2 "Search all" --width 600` puts "Search--Test 2" puts response2 puts searchText = "foobar" resp=`CocoaDialog inputbox --title "Search--Test 3" --no-newline --informative-text "Enter your search term" --text #{searchText} --button1 "Search" --button2 "Search all" --width 600` response4 = resp.split puts "Search--Test 3" if response4[0]=="1" puts " You asked to search for #{response4[1]}" elsif response4[0]=="2" puts " You asked to search ALL for #{response4[1]}." else puts "response4[0]: #{response4[0]}, but not working like it should. " end -- Posted via http://www.ruby-forum.com/.