It occurs to me that having a custom ui framework would be helpful.
The usual widgets such as buttons, menu's, text inputs, text windows, canvas, etc

But what if a game uses a button to drag-drop a new building to a location on a canvas.
How does that work in the sense of pure lua and love2d.

How about keyboard and mouse focus for various widgets on the main window (will borrow from Tk there)

Callbacks...   Code hooks on buttons etc.

Like some window managers, a right click at a location could just pop up a menu of choices.
Gotta do all the low level stuff like figuring out which widget is being clicked on, what is being dragged and what widget is it being dropped on.   Highlighting text in a window to copy.  Details!!

Base class/object would be the mainWindow
Next would be a bare widget
Children would be button, textinput, text, canvas, menu, menu bar, popup menu, etc.