-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
example: add example to include a lua file to C code
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
- Loading branch information
Showing
3 changed files
with
28 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-- Everything is already setup in C code, check mixed.c | ||
-- Everything is already setup in C code, check lua_in_c.c | ||
-- This file is just to trigger the demo | ||
|
||
embed_lua_in_c() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
STRINGIZE((function() --\n | ||
local root = lvgl.get_child_by_id("luaUIroot") | ||
root.w = lvgl.VER_RES() | ||
root.h = lvgl.HOR_RES() | ||
|
||
Button(root, { | ||
id = "Button in Lua", | ||
Label { | ||
text = "Hello, lua, C and lvgl!", | ||
align = lvgl.ALIGN_CENTER | ||
} | ||
}):center() | ||
|
||
-- Keep this comment | ||
end)()) |