るりまサーチ

最速Rubyリファレンスマニュアル検索!
72件ヒット [1-72件を表示] (0.021秒)
トップページ > クラス:WIN32OLE_EVENT[x] > クエリ:on_event[x]

別のキーワード

  1. optparse on
  2. optionparser on
  3. tracer on
  4. thread abort_on_exception
  5. thread abort_on_exception=

ライブラリ

キーワード

検索結果

WIN32OLE_EVENT#on_event(event = nil) {|*args| ... } -> () (18126.0)

イベント通知を受けるブロックを登録します。

...
WIN32OLE_EVENT
#on_event_with_outargsを利用してください。

@raise WIN32OLERuntimeError WIN32OLE_EVENT#unadviseによってイベン
トソースと切断済みです。

ie = WIN32OLE.new('InternetExplorer.Application')
ev = WIN32OLE_EVENT.new...
...(ie, 'DWebBrowserEvents2')
ev.on_event("NavigateComplete2") do |browser, url|
puts url
end

同じオブジェクトに対してeventパラメータを指定したブロックと指定しないブ
ロックが混在している場合、通知されたイベントに対応するブロック...
...呼び出されます。

ie = WIN32OLE.new('InternetExplorer.Application')
ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
ev.on_event("NavigateComplete2") do |browser, url|
puts url
end
ev.on_event do |*args| # <- NavigateComplete2イベント時は実行されない
puts ar...

WIN32OLE_EVENT#on_event_with_outargs(event = nil) {|*args| ... } -> () (6114.0)

イベント通知を受けて結果を呼び出し元へ返すブロックを登録します。

...を指定します。引数を省略した場合は、すべて
のイベントを対象とするブロックの登録となります。

WIN32OLE_EVENT
#on_eventと異なり、イベントのブロック変数に戻り値を
設定できます。

@param event イベント名を文字列かシンボ...
...い。

@raise WIN32OLERuntimeError WIN32OLE_EVENT#unadviseによってイベン
トソースと切断済みです。

ie = WIN32OLE.new('InternetExplorer.Application')
ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
ev.on_event('BeforeNavigate2') do |*args|
a...

WIN32OLE_EVENT#off_event(event = nil) -> () (29.0)

WIN32OLE_EVENT#on_eventで登録したブロックを解除します。

...WIN32OLE_EVENT#on_eventで登録したブロックを解除します。

@param event 文字列またはシンボルで登録時に指定したイベント名を指定しま
す。nilの場合、WIN32OLE_EVENT#on_eventに対してnilを指定したブロッ
クを解除します。

ev = WIN32OLE_...
...EVENT.new(ie, 'DWebBrowserEvents')
ev.on_event(:NavigateComplete) {|url| puts url }
...
ev.off_event(:NavigateComplete)...

WIN32OLE_EVENT#handler=(obj) -> () (7.0)

イベント処理を実行するオブジェクトを登録します。

...rer.Application.1')
event = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
event.handler = IeHandler.new
ie.Navigate2 'http://www.ruby-lang.org/ja/'
loop do
break if event.handler.completed
WIN32OLE_EVENT
.message_loop
end
ie.Quit

WIN32OLE_EVENT
#on_eventなどの呼び出しでブ...

WIN32OLE_EVENT#unadvise -> () (7.0)

イベント通知元をオブジェクトから切断します。

...を受けられなくなります。また、このオブ
ジェクトを利用したWIN32OLE_EVENT#on_eventなどの呼び出しはエラー
(WIN32OLERuntimeErrorの通知)となります。

WIN32OLE_EVENT
オブジェクトは一度生成すると、イベントハンドラが登録され
...

絞り込み条件を変える

WIN32OLE_EVENT.message_loop -> () (7.0)

Windowsのメッセージポンプを実行します。

...スパッチすることで通知されます。

ie = WIN32OLE.new('InternetExplorer.Application.1')
event = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
b = false
event.on_event('DocumentComplete') do |disp, uri|
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.inner...
...lang.org/ja/downloads/ など
end
disp.quit
b = true
end
ie.Navigate2 'http://www.ruby-lang.org/ja/'
loop do
break if b
WIN32OLE_EVENT
.message_loop
end

なお、メソッド名はloopですが、呼び出し時および既にキューイングされたメッ
セージの...