#!/home/nop/lua-fltk/flua
-- This is how *all* callbacks show up in lua-land, with w as the widget
function fltk_dispatch(w) if w.callback then w:callback() end end

w = Fl_Window:new(400,400,"generic window")

menubar = Fl_Menu_Bar:new(0,0,400,30)
menubar:add("File/Open")
menubar:add("File/Close")
menubar:add("File/Quit")
menubar:add("&Edit/Cut")
menubar:add("&Edit/Copy")
menubar:add("&Edit/&Paste")

function menubar:callback() print(self:value()) end
fl_cb(menubar)
w:show()
