Skip to content

Question: Dynamically create Menu lines. How? #114

Answered by MunifTanjim
LinArcX asked this question in Q&A
Discussion options

You must be logged in to vote

Have you tried doing:

function nvim_settings.select_arch_type(title, arch_types)
  local lines = {}
  for i, arch_type in ipairs(arch_types) do
    lines[i] = Menu.item(arch_type)
  end
  
  local menu = Menu({
    -- ...
  }, {
    -- ...
    lines = lines,
    -- ...
  })

  -- ...
end

nvim_settings.select_arch_type("Select Arch Type", { 'x86', 'x64' })

?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@LinArcX
Comment options

Answer selected by LinArcX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #113 on March 23, 2022 08:53.