ui
ui copied to clipboard
Input event for text box base
Hey there, I noticed that it would be really useful, if the text_box_base actually had an input event using e.g. a uistring not only for consistency's sake, but also because it would be really useful. It would just allow to write code much easier with less problems like the following:
ui::string_box text(parent, "text");
text.on_edit([&](){somevar = std::stof(text.text().string());});
Which throws: libs/ui/src/text_box.cpp(102): assert ""impl"" failed in text(): Widget should be created
(I have no clue what this means, maybe I'm just doing something stupid)
I would be pretty pleased if you added this!
Thanks!
Each widget should be created before use, and each child widget should have a parent. Not created widget acts like initialized with nullptr
pointer.
Each widget should be created before use, and each child widget should have a parent. Not created widget acts like initialized with
nullptr
pointer.
I just noticed that I copied that code part wrong. But my point still stands: An input even that already supplies the new text doesn't exist and would be really useful imo.
Yes, it would be nice to have a custom event with text value.