edgetx icon indicating copy to clipboard operation
edgetx copied to clipboard

lvgl can not use OO style api on widgets

Open offer-shmuely opened this issue 10 months ago • 1 comments

What part of EdgeTX is the focus of this bug?

Transmitter firmware

Current Behavior

the following code is working in one-time script, but fail in widgets

    lvgl.clear();

    local box = lvgl.box({x=100, y=10})
    box:rectangle({x=0, y=0, w=100, h=100, color=YELLOW, filled=false, rounded=8, thickness=4})
    box:rectangle({x=10, y=10, w=100, h=100, color=YELLOW, filled=false, rounded=8, thickness=4})

Image

Expected Behavior

I expect the we can use OO style on widgets as weel

box:rectangle()

Steps To Reproduce

use this widget

local app_name="t_lvglCtx4"

local options={}
local function create(zone, options)
    local wgt={zone=zone, options=options}
    return wgt
end

local function update(wgt, options)
    wgt.options=options
    lvgl.clear();
    local box = lvgl.box({x=100, y=100})
    box:rectangle({x=0, y=0, w=100, h=100, color=ORANGE, filled=false, rounded=8, thickness=4})
end

local function background(wgt)
end

local function refresh(wgt)
end

return {name=app_name,create=create,options=options,update=update,refresh=refresh,background=background,useLvgl=true}


Version

2.11.0-rc

Transmitter

RadioMaster TX16S / TX16SMK2

Operating System (OS)

Windows

OS Version

win11

Anything else?

No response

offer-shmuely avatar Mar 09 '25 21:03 offer-shmuely

Fixed in #5926

philmoz avatar Mar 10 '25 03:03 philmoz

@pfeerick This issue has been fixed Can you close the issue?

offer-shmuely avatar Aug 01 '25 13:08 offer-shmuely