Sha256: b9a76f538adc634b75e005112ee28deb1ffced318b241e9ca9df7f80b0f3d6c7

Contents?: true

Size: 552 Bytes

Versions: 1

Compression:

Stored size: 552 Bytes

Contents

require 'Win32API'
Dir[File.dirname(__FILE__) + "/messagebox" << '/*.rb'].each do |file|
  require file
end

class MessageBox
  def initialize(title, message, style = 0)
    @title = title
    @message = message
    @style = style
  end

  def self.show(title, message, style = 0)
    Win32API.new(
      "user32",
      "MessageBox",
      %w(p p p i),
      'i'
    ).call(nil, message, title, style)  
  end

  def show(message = nil, title = nil)
    MessageBox.show(title || @title, message || @message, @style)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
messagebox-0.1.0 lib/messagebox.rb