diff options
Diffstat (limited to 'examples/002-ApplicationList.rb')
-rw-r--r-- | examples/002-ApplicationList.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/002-ApplicationList.rb b/examples/002-ApplicationList.rb new file mode 100644 index 0000000..c2ec168 --- /dev/null +++ b/examples/002-ApplicationList.rb @@ -0,0 +1,20 @@ +#!/usr/bin/ruby + +$:.unshift( ".." ) + +require "ivy" + +ivy = IVY.new( "TestRbAppList", "TestRbAppList Ready" ) +ivy.start( ) + +msg = ivy.bindmsg( nil, "^quit$" ) { |app, data, tab| + ivy.stop( ) +} + +msg2 = ivy.bindmsg( nil, "^who$" ) { |app, data, tab| + ivy.applicationList.each do |x| + ivy.sendmsg( "APP: #{x}" ) + end +} + +ivy.mainloop( ) |