modify readme

This commit is contained in:
ruki
2018-11-20 00:42:08 +08:00
parent 7cb0cdd945
commit 100650db0a
2 changed files with 29 additions and 4 deletions

View File

@@ -31,17 +31,32 @@
LTUI is a cross-platform terminal ui library based on Lua.
## Examples
## Snapshot
#### menuconf
![](https://tboox.org/static/img/ltui/choicebox.png)
#### inputdialog
![](https://tboox.org/static/img/ltui/inputdialog.png)
#### textarea
![](https://tboox.org/static/img/ltui/textarea.png)
If you want to known more, please refer to:
* [HomePage](http://www.tboox.org)
* [HomePage](https://tboox.org)
* [Github](https://github.com/tboox/ltui)
* [Gitee](https://gitee.com/tboox/ltui)
## Contacts
* Email[waruqi@gmail.com](mailto:waruqi@gmail.com)
* Homepage[tboox.org](http://www.tboox.org)
* Homepage[tboox.org](https://tboox.org)
* Community[/r/tboox on reddit](https://www.reddit.com/r/tboox/)
* ChatRoom[Char on telegram](https://t.me/tbooxorg), [Chat on gitter](https://gitter.im/tboox/tboox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
* Source Code[Github](https://github.com/tboox/ltui), [Gitee](https://gitee.com/tboox/ltui)

View File

@@ -46,9 +46,19 @@ function demo:init()
-- init background
self:background_set("blue")
-- read help content
local helptext = nil
local file = io.open("./LICENSE.md", 'r')
if file then
helptext = file:read("*a")
file:close()
end
-- init help dialog
local dialog_help = textdialog:new("dialog.help", rect {1, 1, self:width() - 1, self:height() - 1}, "README")
dialog_help:text():text_set("help text ...")
if helptext then
dialog_help:text():text_set(helptext)
end
dialog_help:button_add("exit", "< Exit >", function (v) self:remove(dialog_help) end)
-- init main dialog
@@ -75,7 +85,7 @@ function demo:init()
-- init tips dialog
local dialog_tips = textdialog:new("dialog.tips", rect {0, 0, 50, 8}):background_set(dialog_main:frame():background())
dialog_tips:frame():background_set("cyan")
dialog_tips:text():text_set("hello xmake! (http://xmake.io)\nA cross-platform terminal ui library based on Lua"):textattr_set("red")
dialog_tips:text():text_set("hello ltui! (https://tboox.org)\nA cross-platform terminal ui library based on Lua"):textattr_set("red")
dialog_tips:button_add("yes", "< Yes >", function (v) dialog_tips:show(false) end)
dialog_tips:button_add("no", "< No >", function (v) dialog_tips:show(false) end)
self:insert(dialog_tips, {centerx = true, centery = true})