textLayout
Show text with wrapping (optional). Supports mouse and touch selection.
Text is added incrementally with TextLayoutWidget.addText or
TextLayoutWidget.format. Each call can have different styling.
Only valid between Window.beginand Window.end.
Parameters
- src:std.builtin.SourceLocation
- std.builtin.SourceLocation
- init_opts:TextLayoutWidget.InitOptions
- TextLayoutWidget.InitOptions
- opts:Options
- Options
Source
Implementation
pub fn textLayout(src: std.builtin.SourceLocation, init_opts: TextLayoutWidget.InitOptions, opts: Options) *TextLayoutWidget {
var ret = widgetAlloc(TextLayoutWidget);
ret.init(src, init_opts, opts);
// can install corner widgets here
//_ = dvui.button(@src(), "upright", .{}, .{ .gravity_x = 1.0 });
if (ret.touchEditing()) |floating_widget| {
defer floating_widget.deinit();
ret.touchEditingMenu();
}
ret.processEvents();
// call addText() any number of times
// can call addTextDone() (will be called automatically if you don't)
return ret;
}