Sha256: b78135586d284b2ca63fbf8432c85c62ba0acab77e6fa883870e29002f8bed85

Contents?: true

Size: 823 Bytes

Versions: 4

Compression:

Stored size: 823 Bytes

Contents

module Bowline
  module Desktop
    module Dialog
      def message(msg, options = {})
        style = 0
        style |= YES_NO if options[:yes_no]
        style |= OK     if options[:ok]
        style |= CANCEL if options[:cancel]
        style |= ICON_EXCLAMATION if options[:icon_exclamation]
        style |= ICON_HAND   if options[:icon_hand]
        style |= ICON_ERROR  if options[:icon_error]
        style |= QUESTION    if options[:question]
        style |= INFORMATION if options[:information]
        caption = options[:caption] || "Message"
        
        result = _message(msg, caption, style)
        
        case result
        when YES then :yes
        when NO  then :no
        when OK  then :ok
        when CANCEL then :cancel
        end
      end
      module_function :message
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bowline-0.5.3 lib/bowline/desktop/dialog.rb
bowline-0.5.2 lib/bowline/desktop/dialog.rb
bowline-0.5.1 lib/bowline/desktop/dialog.rb
bowline-0.5.0 lib/bowline/desktop/dialog.rb