Thank you for responding. But this will generate a multiple awful.popup
. What I need is to generate a widget inside the awful.popup
. I will make an example below:
-- Let's say I just want to generate a `widget.textbox` on button press
-- The textbox widget to generate on button press
local genText = function()
texttest = wibox.widget {
wibox.widget {
text = 'foobar',
widget = wibox.widget.textbox,
},
layout = wibox.layout.align.vertical
}
return texttest
end
-- The awful.popup
awful.popup {
widget = {
{
{
genText(), -- I WANT TO GENERATE MULTIPLE INSTANCE OF THIS ON BUTTON PRESS REALTIME
layout = wibox.layout.fixed.vertical,
},
layout = wibox.layout.align.vertical,
},
margins = 10,
widget = wibox.container.margin
},
border_color = '#ff00ff',
border_width = 5,
placement = awful.placement.centered,
shape = gears.shape.rounded_rect,
hide_on_right_click = false,
visible = true,
}
-- The button that will call the genText() to generate a textbox.
-- But clearly, this doesn't work
widget_button:buttons(
gears.table.join(
awful.button(
{},
1,
nil,
function()
genText()
end
)
)
)
Sorry for the messy code. I've been experimenting this for quite awhile now and I'm just new to lua and awesome wm. Thank you, again.