0

So I've been trying to create a popup widget which should include 3 other widgets inside of it. I had to fix a bunch of things before I could get it to run without spitting out more errors. So I am at the point where I am trying to run it to see if it really is working. I made a button(day_button.lua) which will trigger the visibility of the container(empty-container.lua). So I typed at the top of rc.lua: local customclock = require("day_button") which like I said gave no output of any errors. I tried to place the button in my wibar like so: wibar(you can find it under the widget mytextclock). So by trying to "summon" the button I get these errors. I don't know what to do from this point forward. These errors aren't very helpful and I'm not that experienced.

I will also include day_button.lua and empty-container.lua for better context.

Please help.

xorg
  • 137
  • 1
  • 1
  • 11

1 Answers1

0

The error message tells you that you're indexing a local boolean value v. You may only index table values.

So you're doing someting like v.someKey or v[somekey] or v:someKey in the mentioned line.

v is probably part of a generic for loop. So you probably have a boolean value in a table where you expect a table value.

you know what you're doing wrong and you know where. The only thing that's left is to fix it. So find out why there is a boolean where you expect a table. If it should be a boolean, don't index it. If it should be a table, make sure it actually is a table.

Piglet
  • 27,501
  • 3
  • 20
  • 43
  • It appears that I had to scrap a part of the code (which is the display_button. It didn't act as a button and I also had to return something at the end of the file). I modified `local button = {}` instead to `local button = wibox.widget {...}`. The error displayed above was and is completely irrelevant to what the actual issue was. On another note, If I knew what I was doing wrong and I knew where, I wouldn't have asked for help on this forum, or on any forum. – xorg Sep 22 '21 at 12:12
  • @xorg the error message tells you what you're doing wrong and where, you don't have to know that. that's what error messages are for. I'm a professional Lua programmer and I don't know what I'm doing wrong either, until the interpreter tells me. – Piglet Sep 22 '21 at 14:44