Class: IE

Inherits:
Object show all
Defined in:
lib/rwd/rwd.rb

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ IE

Returns a new instance of IE.



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rwd/rwd.rb', line 62

def initialize(url)
  @ie = WIN32OLE.new("InternetExplorer.Application")
  @ev	= WIN32OLE_EVENT.new(@ie, "DWebBrowserEvents2")

  @ie.navigate(url)

  @ie.menubar		= false
  @ie.toolbar		= false
  @ie.addressbar	= false
  @ie.statusbar	= false

  @ie.visible		= true

  at_exit do
    @ie.visible	= false
  end

  @ev.on_event("OnQuit") do
    Thread.main.exit
  end

  Thread.new do
    loop do
      WIN32OLE_EVENT.message_loop
    end
  end
end