diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-02-23 15:42:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-23 15:42:05 +0100 |
| commit | 9f87af8ad9a3d8112518b6bbb5b6075881a5b9a2 (patch) | |
| tree | fe96512734abb7b29bc6b8fac9816d7cc0c4ae3f /test/ask.cxx | |
| parent | 92818939267fc7fbb6a33d86fb78576f55ce6aca (diff) | |
Fl_String refactoring and extension (#683)
- add true unittest and Fl_String testing
- interface and printout are similar to gtest
without requiring external linkage.
just run `unittest --core`.
- new Fl_String API
- extended API to fl_input_str and fl_password_str
- co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
Diffstat (limited to 'test/ask.cxx')
| -rw-r--r-- | test/ask.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/ask.cxx b/test/ask.cxx index 0c2365149..973a42d11 100644 --- a/test/ask.cxx +++ b/test/ask.cxx @@ -34,16 +34,17 @@ void rename_button(Fl_Widget *o, void *v) { int what = fl_int(v); + int ret = 0; Fl_String input; if (what == 0) { fl_message_icon_label("§"); - input = fl_input_str(0, "Input (no size limit, use ctrl/j for newline):", o->label()); + input = fl_input_str(ret, 0, "Input (no size limit, use ctrl/j for newline):", o->label()); } else { fl_message_icon_label("€"); - input = fl_password_str(20, "Enter password (max. 20 characters):", o->label()); + input = fl_password_str(ret, 20, "Enter password (max. 20 characters):", o->label()); } - if (input.value()) { - o->copy_label(input.value()); + if (ret == 0) { + o->copy_label(input.c_str()); o->redraw(); } } |
