Revision: 2276
Updated Code
at January 30, 2007 18:47 by gtcaz
Updated Code
#!/usr/bin/env ruby -w
COCOA_DIALOG = "#{ENV['TM_SUPPORT_PATH']}/bin/CocoaDialog.exe"
res=%x("#{COCOA_DIALOG}" dropdown \
--title "Favorite OS" \
--text "What is your favorite operating system?" \
--items "Mac OS X" "OpenSolaris" "Windows" \
--button1 'That one!' --button2 "Cancel")
button, item = res.split
case button
when "1":
case item
when "0": puts "Fanboy!"
when "1": puts "ZFS Rules!"
when "2": puts "Thank heaven for e and Cygwin!"
end
when "2": puts "Fine, be that way."
else puts "Something went very, very wrong."
end
Revision: 2275
Updated Code
at January 29, 2007 20:29 by gtcaz
Updated Code
#!/usr/bin/env ruby -w
COCOA_DIALOG = '/cygdrive/c/Program Files/e/Support/bin/CocoaDialog.exe'
res=%x("#{COCOA_DIALOG}" dropdown \
--title "Favorite OS" \
--text "What is your favorite operating system?" \
--items "Mac OS X" "OpenSolaris" "Windows" \
--button1 'That one!' --button2 "Cancel")
button, item = res.split
case button
when "1":
case item
when "0": puts "Fanboy!"
when "1": puts "ZFS Rules!"
when "2": puts "Thank heaven for e and Cygwin!"
end
when "2": puts "Fine, be that way."
else puts "Something went very, very wrong."
end
Revision: 2274
Updated Code
at January 29, 2007 20:25 by gtcaz
Updated Code
#!/usr/bin/env ruby -w
COCOA_DIALOG = '/cygdrive/c/Program Files/e/Support/bin/CocoaDialog.exe'
res=%x("#{COCOA_DIALOG}" dropdown \
--title "Favorite OS" \
--text "What is your favorite operating system?" \
--items "Mac OS X" "OpenSolaris" "Windows" --button1 'That one!' \
--button2 "Cancel")
button, item = res.split
case button
when "1":
case item
when "0": puts "Fanboy!"
when "1": puts "ZFS Rules!"
when "2": puts "Thank heaven for e and Cygwin!"
end
when "2": puts "Fine, be that way."
else puts "Something went very, very wrong."
end
Revision: 2273
Updated Code
at January 29, 2007 20:24 by gtcaz
Updated Code
#!/usr/bin/env ruby -w
COCOA_DIALOG = '/cygdrive/c/Program Files/e/Support/bin/CocoaDialog.exe'
res=%x("#{COCOA_DIALOG}" dropdown \
--title "Favorite OS" \
--text "What is your favorite operating system?" \
--items "Mac OS X" "GNU/Linux" "Windows" --button1 'That one!' \
--button2 "Cancel")
button, item = res.split
case button
when "1":
case item
when "0": puts "Fanboy!"
when "1": puts "Linux geek!"
when "2": puts "Thank heaven for e and Cygwin!"
end
when "2": puts "Fine, be that way."
else puts "Something went very, very wrong."
end
Revision: 2272
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at January 29, 2007 20:07 by gtcaz
Initial Code
#!/usr/bin/env ruby -w
COCOA_DIALOG = '/cygdrive/c/Program Files/e/Support/bin/CocoaDialog.exe'
res=%x("#{COCOA_DIALOG}" dropdown \
--title "Favorite Cofee Drink" \
--text "What is your Favorite Cofee Drink?" \
--items "Mac OS X" "GNU/Linux" "Windows" --button1 'That one!' \
--button2 "Cancel")
button, item = res.split
case button
when "1":
case item
when "0": puts "You like Mac OS X!"
when "1": puts "Linux geek!"
when "2": puts "Thank heaven for e and Cygwin!!"
end
when "2": puts "Fine, be that way."
else puts "Something went very wrong!"
end
Initial URL
Initial Description
This is an example of how to use the wxCocoaDialog dropdown widget from Ruby.
Initial Title
wxCocoaDialog dropdown example in Ruby
Initial Tags
ruby
Initial Language
Ruby