I've checked and both update() functions are definitely called. Just insert print(self) at the beginning of the update function in gui.addBtn() and gui.addToggle() to see that.
However, you're redefining love.mousepressed inside both update functions. The Löve frame loop works roughly like this (some finer details are missing):
- read inputs
- call input events and any other events except love.update() and love.draw()
- call love.update(dt)
- clear the screen
- call love.draw()
- paint what was drawn
- start again
Guess what, love.mousepressed is one of these input events that are called in the second step. So what's happening is this:
- When love.update is executed, you're redefining love.mousepressed twice, once for the button and once for the toggle.
- The last value assigned (the one for the toggle) prevails.
- Then everything is drawn etc. and the frame cycle begins again; the inputs are read.
- Now love.mousepressed has a chance to run, but note that the event keeps the last value that it was set to, which is that of the toggle.
As a result, you only see one of the buttons take effect, because love.mousepressed is never set for the other one when the time to execute love.mousepressed comes.
A possible fix is to have a mousepressed method in the button and the toggle class; you don't really need an update function. Then have love.mousepressed (in main.lua) call the mousepressed events in all controls just like you do with update and draw.
Aside from that, there's a lot of abuse of globals; I didn't see any outstanding problems with it but it's a question of time that it will come bite you in the butt. In Lua, the rule of thumb is to keep everything local unless you really, really need it global, which is hardly ever.