On Wed, Dec 29, 2010 at 16:10, Uli Schlachter <[email protected]> wrote:
> Basically, you create a textbox (let's call it pete) and then do something
> like:
>
> function my_foo_bar(foo)
> print("The user entered: ", foo)
> end
> awful.prompt({}, pete, my_foo_bar)
To better the emulation of an editbox you can use:
awful.prompt({ text = pete.text, selectall = true}, pete, my_foo_bar)
This will fill in the prompt with textbox's content, as well as select
all the content.
So to edit the textbox upon click:
pete:buttons(awful.util.table.join(
awful.button({}, 3, function () awful.prompt({ text = pete.text,
selectall = true}, pete, my_foo_bar) end)
))
You also probably want to set the textbox's text in my_foo_bar():
function my_foo_bar(foo)
print("The user entered: ", foo)
pete.text = foo
end
And so on. The code above is untested. A while ago I made
awful.widget.editbox which basically combined these techniques into a
reusable module but that code is now gone after a hdd crash.
Hope this helps
koniu
PS. psychon, meaningful var names ftw ;]
--
To unsubscribe, send mail to [email protected].