Force dialog controls same row?

Is there any way to force dialog controls to appear on the same row as the previous control?
Buttons seem fine, but numbers and sliders are appearing on new rows.

Hi surt,

Call Dialog:newRow with always set to false. Only the first widget in a row should have a label. If subsequent widgets have a label, they will be displayed on a new row. I haven’t tested this with all widget types, or with mixing and matching widget types (e.g., a check box and a combo box on the same row), so I don’t know that it will work in all cases. [Edit: looks like they have to be the same type.]

sameRow

local dlg = Dialog { title = "Same Row" }

dlg:slider {
    id = "a",
    label = "Label 1:",
    min = 0,
    max = 100,
    value = 50
}

dlg:slider {
    id = "b",
    -- label = "No.",
    min = 0,
    max = 100,
    value = 50
}

dlg:newrow { always = false }

dlg:number {
    id = "c",
    label = "Label 2:",
    text = string.format("%.1f", 0.25),
    decimals = 1
}

dlg:number {
    id = "d",
    -- label = "No.",
    text = string.format("%.1f", 0.75),
    decimals = 1
}

dlg:show { wait = false }

Best,
Jeremy

3 Likes

Cheers, that did the trick. I’d just assumed it defaulted to always=false given that it didn’t affect buttons.

Actually it’s not working with both slider and button in the same row.

A new widget type always makes a new row, I don’t think you can override that.

1 Like