DVUI

dataSetDeinitFunction

Set a deinit function for value stored under key (id+name).

Can be called from any thread.

If called from non-GUI thread or outside Window.begin/Window.end, you must pass a pointer to the Window you want to add the value to.

When value for this id/name is about to be freed by dvui, it will first call the passed function. This is useful for cases where value for a widget allocates memory outside of your control.

Parameters

#
win:?*Window
?*Window
id:Id
Id
name:[]const u8
[]const u8
func:Data.DeinitFunction
Data.DeinitFunction

Source

Implementation

#
pub fn dataSetDeinitFunction(win: ?*Window, id: Id, name: []const u8, func: Data.DeinitFunction) void {
    data.deinitFunction(win, .widget(id, name), func);
}