Closed RobLoach closed 3 months ago
I think your suggestion to have an enum for the event type seems reasonable. That'll help reduce the API surface for event handling.
Have nk_console_event_handler* events in nk_console as a cvector for all events
Are you suggesting all events are stored in a single array that's scanned when an event is triggered? Seems like a clean approach and performance shouldn't be a concern given events are triggered relatively infrequently - so I think this is decent way to implement this
@brianwatling following discussion here so we don't lose it. Thoughts on this? Goal is to consolidate most event systems into just one
nk_console_event_handler* events
.enum nk_console_event_type
withDESTROY
,CHANGE
, andCLICK
enum nk_console_event_type
tonk_console_event_handler
nk_console_event_handler* events
innk_console
as a cvector for all eventsnk_console_button_data::onchange
to the new events patternnk_console::destroy
to the new events patternrender
outside of the event system to keep performance a priorityenum nk_console_event_type
nk_console_onchange(widget)
, callnk_console_invoke(widget, NK_CONSOLE_EVENT_TYPE_CHANGE)
... or something?nk_console_set_onchange_handler()
tonk_console_add_event_handler()
nk_console_set_onchange()
tonk_console_add_event