awful: fix to use new widget API

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-26 17:53:38 +02:00
parent 25f795b04f
commit 19a454d978
1 changed files with 5 additions and 5 deletions

View File

@ -618,7 +618,7 @@ function P.prompt(args, textbox, exe_callback, completion_callback)
if not textbox or not exe_callback then if not textbox or not exe_callback then
return return
end end
textbox:set("text", prompt .. prompt_text_with_cursor(text, inv_col, cur_col, cur_pos)) textbox:text_set(prompt .. prompt_text_with_cursor(text, inv_col, cur_col, cur_pos))
keygrabber.run( keygrabber.run(
function (mod, key) function (mod, key)
local has_ctrl = false local has_ctrl = false
@ -631,16 +631,16 @@ function P.prompt(args, textbox, exe_callback, completion_callback)
-- Get out cases -- Get out cases
if has_ctrl then if has_ctrl then
if key == "g" then if key == "g" then
textbox:set("text", "") textbox:text_set("")
return false return false
end end
else else
if key == "Return" then if key == "Return" then
textbox:set("text", "") textbox:text_set( "")
exe_callback(command) exe_callback(command)
return false return false
elseif key == "Escape" then elseif key == "Escape" then
textbox:set("text", "") textbox:text_set("")
return false return false
end end
end end
@ -716,7 +716,7 @@ function P.prompt(args, textbox, exe_callback, completion_callback)
end end
-- Update textbox -- Update textbox
textbox:set("text", prompt .. prompt_text_with_cursor(command, inv_col, cur_col, cur_pos)) textbox:text_set(prompt .. prompt_text_with_cursor(command, inv_col, cur_col, cur_pos))
return true return true
end) end)