initWithDisplayFn
Use a custom display function to display this struct.
Parameters
- customDisplayFn:*const fn (field_name: []const u8, field_value_ptr: *anyopaque, read_only: bool, *dvui.Alignment) void
- *const fn (field_name: []const u8, field_value_ptr: *anyopaque, read_only: bool, *dvui.Alignment) void
- default_value:?StructT
- ?StructT
Source
Implementation
pub fn initWithDisplayFn(
// Display the struct using this function, instead of the default struct_ui function.
customDisplayFn: *const fn (field_name: []const u8, field_value_ptr: *anyopaque, read_only: bool, *dvui.Alignment) void,
comptime default_value: ?StructT,
) Self {
return .{
.field_options = .init(.{}),
.customDisplayFn = customDisplayFn,
.default_value = default_value,
};
}