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.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/rwd/rwd.rb', line 80

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