require 'System.Windows.Forms'
include System::Windows::Forms
class RForm < Form
end
f = RForm.new
ome = proc {|sender, e| puts "Enter"}
oml = proc {|sender, e| puts "Leave"}
f.mouse_enter(&ome)
f.mouse_leave(&oml)
include System::Windows::Forms
class RForm < Form
end
f = RForm.new
ome = proc {|sender, e| puts "Enter"}
oml = proc {|sender, e| puts "Leave"}
f.mouse_enter(&ome)
f.mouse_leave(&oml)
Application.run(f)
~~THE END~~
尹曙光
本文展示了一个使用Ruby语言创建简单GUI应用程序的例子,通过System.Windows.Forms库实现鼠标进入和离开事件的响应。
658

被折叠的 条评论
为什么被折叠?



