diff options
| author | Matthias Melcher <github@matthiasm.com> | 2026-01-04 15:50:49 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2026-01-04 15:50:56 +0100 |
| commit | 0e570fb6729ff6b97249256c2c9d5f3aa58c7bb4 (patch) | |
| tree | 7140e3b2d97c6f7852e915759918d14bf6b35b00 /src/Fl_Counter.cxx | |
| parent | 357336bd40d868fd65e95c61d1adaf9de0fb7811 (diff) | |
Add C++11 Fl_Valuator::format API.
This is helpful for writing language wrapper, in
this particular case for PyFLTK.
Diffstat (limited to 'src/Fl_Counter.cxx')
| -rw-r--r-- | src/Fl_Counter.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Fl_Counter.cxx b/src/Fl_Counter.cxx index 17a1efa19..3536a2213 100644 --- a/src/Fl_Counter.cxx +++ b/src/Fl_Counter.cxx @@ -1,7 +1,7 @@ // // Counter widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2022 by Bill Spitzak and others. +// Copyright 1998-2026 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -102,8 +102,8 @@ void Fl_Counter::draw() { draw_box(tbt, tx, y(), tw, h(), FL_BACKGROUND2_COLOR); fl_font(textfont(), textsize()); fl_color(active_r() ? textcolor() : fl_inactive(textcolor())); - char str[128]; format(str); - fl_draw(str, tx, y(), tw, h(), FL_ALIGN_CENTER); + std::string str = format_str(); + fl_draw(str.c_str(), tx, y(), tw, h(), FL_ALIGN_CENTER); if (Fl::focus() == this) draw_focus(tbt, tx, y(), tw, h()); if (!(damage()&FL_DAMAGE_ALL)) return; // only need to redraw text |
