Function zng_wgt_text::txt_parse
source ยท pub fn txt_parse<T>(child: impl UiNode, value: impl IntoVar<T>) -> impl UiNodewhere
T: TxtParseValue,
Expand description
P
Value that is parsed from the text and displayed as the text.
This is an alternative to txt
that converts to and from T
if it can be formatted to display text and can parse, with
parse error that can display.
If the parse operation fails the value variable is not updated and the error display text is set in DATA.invalidate
, you
can use has_data_error
and get_data_error_txt
to display the error.
See also txt_parse_live
for ways to control when the parse attempt happens.