require 'phi'
require 'tasktray'

tray = Phi::TrayIcon.new
tray.icon = Phi::Icon.new.load('d:/apollo/sample/icon5.ico')
tray.r_button_popup_menu = Phi.new_popup_menu(tray, :menu, [
  Phi.new_item_ex('Menu', '', :mi_menu, [
    Phi.new_item_ex('&A', 'Ctrl+A', proc{p "A"}),
    Phi.new_item_ex('&B', 'Ctrl+B', proc{p "B"}),
    Phi.new_item_ex('&C', 'Ctrl+C', proc{p "C"}),
    Phi.new_item_ex('&D', 'Ctrl+D', proc{p "D"}),
  ])
])
tray.on_mouse_down = proc {|i|p i}

cnt = 0
while true
  #### 룉뿚걁겓걂 ####
  cnt += 1
  p cnt
  #### 룉뿚걁겒걂 ####
  sleep 0.5
  Phi::APPLICATION.process_messages
end
#mainloop