2 -- $Id: menu.lua,v 1.5 2004/11/26 04:28:10 cpressey Exp $
3 -- Test of the DFUI Menu abstraction wrapper thing.
7 local c = DFUIConnection.new("tcp", "9999")
12 -- manually create a menu,
13 -- manually populate it with items, and
14 -- manually present it:
18 short_desc = "This is my menu."
23 short_desc = "This is the first thing",
25 print("This is the 1st thing.")
30 name = "Second Thing",
31 short_desc = "This is the second thing",
33 print("This is the 2nd thing.")
39 short_desc = "This is the third thing",
41 print("This is the 3rd thing.")
45 -- Manually create and add a submenu
47 submenu = Menu.new(c, {
49 short_desc = "This is a submenu"
54 effect = function() print("foo!") end
58 effect = function() print("bar!") end
63 short_desc = "This item leads to a submenu",
71 short_desc = "OK, enough of this",