• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

SDK: Dialog: Variable number of rows in group_box

Community Beginner ,
Nov 20, 2021 Nov 20, 2021

Copy link to clipboard

Copied

[SDK] I need to present a dialogbox with a variable number of rows - I don't know beforehand how many rows there will be. I can't figure out how to do this.

If I do something like 

local groupBox = f:group_box{}

and then use table.insert to add f:row elements I end up with an empty container.

I read somewhere in the manual: "To create the containment hierarchy, use the view factory to create a container, and within that call, use it to create the child containers and controls:" Does that mean that what I want is not possible?

I hope someone can help me out 🙂

 

 

TOPICS
SDK

Views

156

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 20, 2021 Nov 20, 2021

Here's how to do it:

local rows = {}
for i = 1, n do
    table.insert (rows, f:static_text {title = "Row " .. i})
    end
rows.title = "Group Box Title"
local box = f:group_box (rows)

Votes

Translate

Translate
LEGEND ,
Nov 20, 2021 Nov 20, 2021

Copy link to clipboard

Copied

Here's how to do it:

local rows = {}
for i = 1, n do
    table.insert (rows, f:static_text {title = "Row " .. i})
    end
rows.title = "Group Box Title"
local box = f:group_box (rows)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 21, 2021 Nov 21, 2021

Copy link to clipboard

Copied

LATEST

Thank you, master  🙂

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines