Currently this is only done for Lua handlers, not for C++ ones. See `define_script_` in `gui_frame.cpp`.