fix: clear commands when no item in menu

pull/2/merge
Qingping Hou 12 years ago
parent e94fe052d3
commit c89e3efc19

@ -210,6 +210,16 @@ function SelectMenu:addAllCommands()
end)
end
function SelectMenu:clearCommands()
self.commands = Commands:new{}
self.commands:add(KEY_BACK, nil, "",
"Exit menu",
function(sm)
return "break"
end)
end
------------------------------------------------
-- return the index of selected item
------------------------------------------------
@ -244,6 +254,7 @@ function SelectMenu:choose(ypos, height)
renderUtf8Text(fb.bb, 30, y, cface, cfhash,
self.no_item_msg, true)
self.markerdirty = false
self:clearCommands()
else
local c
for c = 1, self.perpage do

Loading…
Cancel
Save