require 'phi'

form = Phi::Form.new :form, $0
pmenu = Phi::PopupMenu.new form, :pmenu
pmenu.auto_popup = true

mitem = Phi::MenuItem.new
mitem.caption = 'test'
mitem.name = 'test'
mitem.short_cut = Phi.text_to_short_cut('Ctrl+T')
mitem.on_click = proc do |args|
  puts 'on_click'
  p args
end
pmenu.on_popup = proc do |args|
  puts 'on_popup'
  p args
end
pmenu.items.add mitem

form.popup_menu = pmenu

form.show
Phi.mainloop
