Skip to content

How to use addChild and setParent? #7

Answered by osch
lastlos asked this question in Q&A
Discussion options

You must be logged in to vote

Here is a simple example using addChild:

local lwtk = require("lwtk")

local Application    = lwtk.Application
local Column         = lwtk.Column
local Row            = lwtk.Row
local PushButton     = lwtk.PushButton
local TitleText      = lwtk.TitleText
local TextLabel      = lwtk.TextLabel
local Space          = lwtk.Space

local app = Application("example")

local win = app:newWindow {
    title = "example",
    Column {
        id = "column1",
        TitleText  { text = "Hello World!", style = { textSize = 35 } },
        Row {
            Space {},
            PushButton { id = "button1",
                         text = "&Add Child" },
            Space {}
        }
    },
}

local c…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@lastlos
Comment options

@lastlos
Comment options

@osch
Comment options

osch Jan 4, 2024
Maintainer

Answer selected by lastlos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants