tboox / ltui

🍖 A cross-platform terminal ui library based on Lua
https://tboox.org
Apache License 2.0
818 stars 49 forks source link

Unexpected label behaviour #34

Open lsdrfrx opened 1 year ago

lsdrfrx commented 1 year ago

I added some labels into the window, but text is hidden or something.

local ltui        = require("ltui")
local application = ltui.application
local event       = ltui.event
local rect        = ltui.rect
local window      = ltui.window
local conf        = ltui.menuconf
local view        = ltui.view
local label       = ltui.label

local app         = application()

function app:init()
    application.init(self, "demo")
    local containers = { "container1", "container2", "container3", "container4" }
    local container_window = window:new("window.container", rect { 1, 1, 50, 10 }, "containers", false)
    for i = 1, 4, 1 do
        container_window:insert(label:new(containers[i], rect { 2, 1 + i, 15, 2 + i }, containers[i]):textattr_set("red"))
    end

    self:insert(container_window)
end

app:run()

Here's what it looks like: image What i'm doing wrong?