slages / love-imgui

imgui module for the LÖVE game engine
MIT License
318 stars 61 forks source link

superfluous args break enums silently #9

Open Alloyed opened 7 years ago

Alloyed commented 7 years ago

This is a bug report, but it's also a walk through my attempt to resolve a specific problem I have on the off-chance you have some advice/might want to help :P

So I want to have a complex InputText widget, tab completion, history, etc. first thing's first, lets see what the callbacks return:

imgui.InputText("test", str, 255, {"CallbackAlways"}, print)

and it never triggers, either from the print function, or as an error: exciting. Maybe there's something wrong with callbacks, let's try a different flag:

changed = imgui.InputText("test", str, 255, {"EnterReturnsTrue", "CallbackAlways"}, print)

nothing either. somehow, the callback is interfering with the enum demarshaller in a way that silently fails. (also btw it'd be nice if callbacks worked). The same thing happens with Begin, which doesn't have extra args, so I'm pretty sure something is up in the definition of OPTIONAL_ENUM.

maybe love-imgui should throw errors if there are unused arguments at the end?