modify readme
This commit is contained in:
19
README.md
19
README.md
@@ -31,17 +31,32 @@
|
|||||||
|
|
||||||
LTUI is a cross-platform terminal ui library based on Lua.
|
LTUI is a cross-platform terminal ui library based on Lua.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
## Snapshot
|
||||||
|
|
||||||
|
#### menuconf
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#### inputdialog
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#### textarea
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
If you want to known more, please refer to:
|
If you want to known more, please refer to:
|
||||||
|
|
||||||
* [HomePage](http://www.tboox.org)
|
* [HomePage](https://tboox.org)
|
||||||
* [Github](https://github.com/tboox/ltui)
|
* [Github](https://github.com/tboox/ltui)
|
||||||
* [Gitee](https://gitee.com/tboox/ltui)
|
* [Gitee](https://gitee.com/tboox/ltui)
|
||||||
|
|
||||||
## Contacts
|
## Contacts
|
||||||
|
|
||||||
* Email:[waruqi@gmail.com](mailto:waruqi@gmail.com)
|
* 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/)
|
* 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)
|
* 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)
|
* Source Code:[Github](https://github.com/tboox/ltui), [Gitee](https://gitee.com/tboox/ltui)
|
||||||
|
@@ -46,9 +46,19 @@ function demo:init()
|
|||||||
-- init background
|
-- init background
|
||||||
self:background_set("blue")
|
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
|
-- init help dialog
|
||||||
local dialog_help = textdialog:new("dialog.help", rect {1, 1, self:width() - 1, self:height() - 1}, "README")
|
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)
|
dialog_help:button_add("exit", "< Exit >", function (v) self:remove(dialog_help) end)
|
||||||
|
|
||||||
-- init main dialog
|
-- init main dialog
|
||||||
@@ -75,7 +85,7 @@ function demo:init()
|
|||||||
-- init tips dialog
|
-- init tips dialog
|
||||||
local dialog_tips = textdialog:new("dialog.tips", rect {0, 0, 50, 8}):background_set(dialog_main:frame():background())
|
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: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("yes", "< Yes >", function (v) dialog_tips:show(false) end)
|
||||||
dialog_tips:button_add("no", "< No >", 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})
|
self:insert(dialog_tips, {centerx = true, centery = true})
|
||||||
|
Reference in New Issue
Block a user