summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/adjuster.cxx5
-rw-r--r--test/ask.cxx11
-rw-r--r--test/clipboard.cxx20
-rw-r--r--test/color_chooser.cxx6
-rw-r--r--test/group.cxx10
-rw-r--r--test/menubar.cxx10
-rw-r--r--test/penpal.cxx68
-rw-r--r--test/threads.cxx37
-rw-r--r--test/unittest_core.cxx27
-rw-r--r--test/utf8.cxx44
10 files changed, 118 insertions, 120 deletions
diff --git a/test/adjuster.cxx b/test/adjuster.cxx
index 9038d13de..c745da32f 100644
--- a/test/adjuster.cxx
+++ b/test/adjuster.cxx
@@ -23,8 +23,9 @@
void adjcb(Fl_Widget *o, void *v) {
Fl_Adjuster *a = (Fl_Adjuster*)o;
Fl_Box *b = (Fl_Box *)v;
- std::string new_label = a->format_str();
- b->copy_label(new_label.c_str());
+ char new_label[64];
+ a->format(new_label);
+ b->copy_label(new_label);
b->redraw();
}
diff --git a/test/ask.cxx b/test/ask.cxx
index 93483b757..8681bc940 100644
--- a/test/ask.cxx
+++ b/test/ask.cxx
@@ -34,17 +34,16 @@
void rename_button(Fl_Widget *o, void *v) {
int what = fl_int(v);
- int ret = 0;
- std::string input;
+ const char *input;
if (what == 0) {
fl_message_icon_label("§");
- input = fl_input_str(ret, 0, "Input (no size limit, use ctrl/j for newline):", o->label());
+ input = fl_input("Input (no size limit, use ctrl/j for newline):", o->label());
} else {
fl_message_icon_label("€");
- input = fl_password_str(ret, 20, "Enter password (max. 20 characters):", o->label());
+ input = fl_password(20, "Enter password (max. 20 characters):", o->label());
}
- if (ret == 0) {
- o->copy_label(input.c_str());
+ if (input) {
+ o->copy_label(input);
o->redraw();
}
}
diff --git a/test/clipboard.cxx b/test/clipboard.cxx
index 562868761..0c74b91aa 100644
--- a/test/clipboard.cxx
+++ b/test/clipboard.cxx
@@ -59,7 +59,7 @@ public:
: Fl_Box(FL_FLAT_BOX, x, y, w, h, 0) {
align(FL_ALIGN_CENTER | FL_ALIGN_CLIP);
}
- void draw() override {
+ void draw() {
draw_box();
Fl_Image *img = image();
if (img) { // draw the chess pattern below the box centered image
@@ -104,9 +104,9 @@ public:
flex->layout();
}
- int handle(int event) override {
+ int handle(int event) {
if (event != FL_PASTE) {
- auto val = value();
+ Fl_Widget *val = value();
int ret = Fl_Tabs::handle(event);
if (value() != val) { // tabs have been changed
layout(); // re-arrange buttons
@@ -124,7 +124,7 @@ public:
#if defined(_WIN32) && defined(DEBUG_CLIPBOARD_DATA)
- OpenClipboard(nullptr); //
+ OpenClipboard(0); //
char *p = title + strlen(title);
int format = EnumClipboardFormats(0);
if (format && format < CF_MAX) {
@@ -171,7 +171,7 @@ public:
// clipboard viewer refresh callback:
// 2nd argument must be `clipboard_viewer *`
void refresh_cb(Fl_Widget *, void *v) {
- auto tabs = (clipboard_viewer *)v;
+ clipboard_viewer *tabs = (clipboard_viewer *)v;
if (Fl::clipboard_contains(Fl::clipboard_image)) {
Fl::paste(*tabs, 1, Fl::clipboard_image); // try to find image in the clipboard
return;
@@ -200,8 +200,8 @@ void save_cb(Fl_Widget *wid, void *) {
// "wrap mode" callback (switch wrapping on/off)
void wrap_cb(Fl_Widget *w, void *d) {
- auto display = (Fl_Text_Display *)d;
- auto wrap = (Fl_Check_Button *)w;
+ Fl_Text_Display *display = (Fl_Text_Display *)d;
+ Fl_Check_Button *wrap = (Fl_Check_Button *)w;
if (wrap->value()) {
display->wrap_mode(Fl_Text_Display::WRAP_AT_BOUNDS, 0);
} else {
@@ -213,13 +213,13 @@ void wrap_cb(Fl_Widget *w, void *d) {
// called after clipboard was changed or at application activation
void clipboard_cb(int source, void *data) {
if (source == 1)
- refresh_cb(nullptr, data);
+ refresh_cb(0, data);
}
int main(int argc, char **argv) {
fl_register_images(); // required for the X11 platform to allow pasting of images
Fl_Window *win = new Fl_Window(500, 550, "FLTK Clipboard Viewer");
- auto tabs = new clipboard_viewer(0, 0, 500, 500);
+ clipboard_viewer *tabs = new clipboard_viewer(0, 0, 500, 500);
Fl_Group *g = new Fl_Group(5, 30, 490, 460, Fl::clipboard_image); // will display the image form
g->box(FL_FLAT_BOX);
image_box = new chess(5, 30, 490, 440);
@@ -242,7 +242,7 @@ int main(int argc, char **argv) {
flex->margin(10, 0, 10, 0); // margins: left, top, right, bottom
flex->gap(10);
- auto refresh = new Fl_Button(0, 0, 0, 0, "Refresh from clipboard");
+ Fl_Button *refresh = new Fl_Button(0, 0, 0, 0, "Refresh from clipboard");
flex->fixed(refresh, 200);
refresh->callback(refresh_cb, (void *)tabs);
diff --git a/test/color_chooser.cxx b/test/color_chooser.cxx
index 88241e10b..e3893aaef 100644
--- a/test/color_chooser.cxx
+++ b/test/color_chooser.cxx
@@ -87,9 +87,9 @@ void cb2(Fl_Widget *, void *v) {
class Sample_Box: public Fl_Box {
public:
- Sample_Box(int x, int y, int w, int h, const char *label = nullptr)
+ Sample_Box(int x, int y, int w, int h, const char *label = 0)
: Fl_Box(x, y, w, h, label) { }
- int handle(int event) override {
+ int handle(int event) {
if (event == FL_BEFORE_TOOLTIP) {
char buf[128];
uchar r, g, b;
@@ -103,7 +103,7 @@ public:
"Background color is:\n"
"r:%d, g:%d, b:%d", r, g, b);
}
- return Fl_Tooltip::override_text(buf);
+ return Fl_Tooltip::_text(buf);
}
return Fl_Box::handle(event);
}
diff --git a/test/group.cxx b/test/group.cxx
index 2e661f560..307d99c17 100644
--- a/test/group.cxx
+++ b/test/group.cxx
@@ -115,7 +115,7 @@ int main(int argc, char **argv) {
g2->end();
- auto bt = new Fl_Button(10, wh + 20, ww - 20, 40, "Move children ...");
+ Fl_Button *bt = new Fl_Button(10, wh + 20, ww - 20, 40, "Move children ...");
bt->callback(button_cb);
tty = new Fl_Terminal(10, wh + 80, ww - 20, th);
@@ -138,10 +138,10 @@ int main(int argc, char **argv) {
int ret = Fl::run();
// reset pointers to give memory checkers a chance to test for leaks
- g1 = g2 = nullptr;
- tty = nullptr;
- b1 = b2 = b3 = b4 = nullptr;
- bt = nullptr;
+ g1 = g2 = 0;
+ tty = 0;
+ b1 = b2 = b3 = b4 = 0;
+ bt = 0;
delete window;
return ret;
diff --git a/test/menubar.cxx b/test/menubar.cxx
index 067661cfa..e6dac6ccc 100644
--- a/test/menubar.cxx
+++ b/test/menubar.cxx
@@ -133,7 +133,7 @@ Fl_Menu_Item menutable[] = {
{"Size", 0, 0},
{0},
{"&Checkbox",FL_F+3,0,0,FL_SUBMENU},
- {" Greek: ", 0, 0, nullptr, FL_MENU_HEADLINE, 0, FL_BOLD },
+ {" Greek: ", 0, 0, 0, FL_MENU_HEADLINE, 0, FL_BOLD },
{"&Alpha", FL_F+2, 0, (void *)1, FL_MENU_TOGGLE},
{"&Beta", 0, 0, (void *)2, FL_MENU_TOGGLE},
{"&Gamma", 0, 0, (void *)3, FL_MENU_TOGGLE},
@@ -141,10 +141,10 @@ Fl_Menu_Item menutable[] = {
{"&Epsilon",0, 0, (void *)5, FL_MENU_TOGGLE},
{"&Pi", 0, 0, (void *)6, FL_MENU_TOGGLE},
{"&Mu", 0, 0, (void *)7, FL_MENU_TOGGLE|FL_MENU_DIVIDER},
- {" Colors: ", 0, 0, nullptr, FL_MENU_HEADLINE, 0, FL_BOLD },
+ {" Colors: ", 0, 0, 0, FL_MENU_HEADLINE, 0, FL_BOLD },
{"Red", 0, 0, (void *)1, FL_MENU_TOGGLE, 0, 0, 0, 1},
{"Black", 0, 0, (void *)1, FL_MENU_TOGGLE|FL_MENU_DIVIDER},
- {" Digits: ", 0, 0, nullptr, FL_MENU_HEADLINE, 0, FL_BOLD },
+ {" Digits: ", 0, 0, 0, FL_MENU_HEADLINE, 0, FL_BOLD },
{"00", 0, 0, (void *)1, FL_MENU_TOGGLE},
{"000", 0, 0, (void *)1, FL_MENU_TOGGLE},
{0},
@@ -252,9 +252,9 @@ void about_cb(Fl_Widget*, void*) {
class Dynamic_Choice: public Fl_Choice {
public:
- Dynamic_Choice(int x, int y, int w, int h, const char *label=nullptr)
+ Dynamic_Choice(int x, int y, int w, int h, const char *label=0)
: Fl_Choice(x, y, w, h, label) { }
- int handle(int event) override {
+ int handle(int event) {
static int flip_flop = 0;
if (event == FL_BEFORE_MENU) {
// The following line is legal because we used `copy()` to create a
diff --git a/test/penpal.cxx b/test/penpal.cxx
index 9b5ddde16..eec1307bb 100644
--- a/test/penpal.cxx
+++ b/test/penpal.cxx
@@ -37,8 +37,8 @@
extern Fl_Menu_Item app_menu[];
extern int popup_app_menu();
-Fl_Widget *cv1 { nullptr };
-Fl_Window *cvwin { nullptr };
+Fl_Widget *cv1 = 0;
+Fl_Window *cvwin = 0;
//
// The canvas interface implements incremental drawing and handles draw events.
@@ -46,17 +46,21 @@ Fl_Window *cvwin { nullptr };
// And it implements an overlay plane that visualizes pen event data.
//
class CanvasInterface {
- Fl_Widget *widget_ { nullptr };
- bool in_window_ { false };
- bool first_draw_ { true };
- Fl_Offscreen offscreen_ { 0 };
- Fl_Color color_ { 1 };
- enum { NONE, HOVER, DRAW, PEN_HOVER, PEN_DRAW } overlay_ { NONE };
- int ov_x_ { 0 };
- int ov_y_ { 0 };
+ Fl_Widget *widget_;
+ bool in_window_;
+ bool first_draw_;
+ Fl_Offscreen offscreen_;
+ Fl_Color color_;
+ enum { NONE, HOVER, DRAW, PEN_HOVER, PEN_DRAW } overlay_;
+ int ov_x_;
+ int ov_y_;
public:
- CanvasInterface(Fl_Widget *w) : widget_(w) { }
- CanvasInterface(Fl_Window *w) : widget_(w), in_window_(true) { }
+ CanvasInterface(Fl_Widget *w)
+ : widget_(w), in_window_(false), first_draw_(true), offscreen_(0),
+ color_(1), overlay_(NONE), ov_x_(0), ov_y_(0) { }
+ CanvasInterface(Fl_Window *w)
+ : widget_(w), in_window_(true), first_draw_(true), offscreen_(0),
+ color_(1), overlay_(NONE), ov_x_(0), ov_y_(0) { }
~CanvasInterface() {
if (offscreen_) fl_delete_offscreen(offscreen_);
}
@@ -215,15 +219,15 @@ void CanvasInterface::cv_pen_paint() {
//
class CanvasWidget : public Fl_Widget, CanvasInterface {
public:
- CanvasWidget(int x, int y, int w, int h, const char *l=nullptr)
+ CanvasWidget(int x, int y, int w, int h, const char *l=0)
: Fl_Widget(x, y, w, h, l), CanvasInterface(this) { }
- ~CanvasWidget() override { }
- int handle(int event) override {
+ ~CanvasWidget() { }
+ int handle(int event) {
// puts(fl_eventname_str(event).c_str());
- auto ret = cv_handle(event);
+ int ret = cv_handle(event);
return ret ? ret : Fl_Widget::handle(event);
}
- void draw() override { return cv_draw(); }
+ void draw() { return cv_draw(); }
};
//
@@ -232,14 +236,14 @@ public:
//
class CanvasWindow : public Fl_Window, CanvasInterface {
public:
- CanvasWindow(int x, int y, int w, int h, const char *l=nullptr)
+ CanvasWindow(int x, int y, int w, int h, const char *l=0)
: Fl_Window(x, y, w, h, l), CanvasInterface(this) { }
- ~CanvasWindow() override { }
- int handle(int event) override {
- auto ret = cv_handle(event);
+ ~CanvasWindow() { }
+ int handle(int event) {
+ int ret = cv_handle(event);
return ret ? ret : Fl_Window::handle(event);
}
- void draw() override { return cv_draw(); }
+ void draw() { return cv_draw(); }
};
// A popup menu with a few test tasks.
@@ -249,7 +253,7 @@ Fl_Menu_Item app_menu[] = {
"pen events while this window is open.");
} },
{ "with non-modal window", 0, [](Fl_Widget*, void*) {
- auto w = new Fl_Window(400, 32, "Toolbox");
+ Fl_Window *w = new Fl_Window(400, 32, "Toolbox");
w->set_non_modal();
w->show();
} },
@@ -260,16 +264,16 @@ Fl_Menu_Item app_menu[] = {
if (cv1) Fl::Pen::subscribe(cv1);
} },
{ "delete middle canvas", 0, [](Fl_Widget*, void*) {
- if (cv1) { cv1->top_window()->redraw(); delete cv1; cv1 = nullptr; }
+ if (cv1) { cv1->top_window()->redraw(); delete cv1; cv1 = 0; }
} },
- { nullptr }
+ { 0 }
};
//
// Show the menu and run the callback.
//
int popup_app_menu() {
- auto mi = app_menu->popup(Fl::event_x(), Fl::event_y(), "Tests");
+ const Fl_Menu_Item *mi = app_menu->popup(Fl::event_x(), Fl::event_y(), "Tests");
if (mi) mi->do_callback((Fl_Widget*)mi);
return 1;
}
@@ -280,26 +284,26 @@ int popup_app_menu() {
int main(int argc, char **argv)
{
// Create our main app window
- auto window = new Fl_Window(100, 100, 640, 220, "FLTK Pen/Stylus/Tablet test, Ctrl-Tap for menu");
+ Fl_Window *window = new Fl_Window(100, 100, 640, 220, "FLTK Pen/Stylus/Tablet test, Ctrl-Tap for menu");
// One testing canvas is just a regular child widget of the window
- auto canvas_widget_0 = new CanvasWidget( 10, 10, 200, 200, "CV0");
+ CanvasWidget *canvas_widget_0 = new CanvasWidget( 10, 10, 200, 200, "CV0");
// The second canvas is inside a group
- auto cv1_group = new Fl_Group(215, 5, 210, 210);
+ Fl_Group *cv1_group = new Fl_Group(215, 5, 210, 210);
cv1_group->box(FL_FRAME_BOX);
- auto canvas_widget_1 = cv1 = new CanvasWidget(220, 10, 200, 200, "CV1");
+ CanvasWidget *canvas_widget_1 = cv1 = new CanvasWidget(220, 10, 200, 200, "CV1");
cv1_group->end();
// The third canvas is a window inside a window, so we can verify
// that pen coordinates are calculated correctly.
- auto canvas_widget_2 = new CanvasWindow(430, 10, 200, 200, "CV2");
+ CanvasWindow *canvas_widget_2 = new CanvasWindow(430, 10, 200, 200, "CV2");
canvas_widget_2->end();
window->end();
// A fourth canvas is a top level window by itself.
- auto cv_window = cvwin = new CanvasWindow(100, 380, 200, 200, "Canvas Window");
+ CanvasWindow *cv_window = cvwin = new CanvasWindow(100, 380, 200, 200, "Canvas Window");
// All canvases subscribe to pen events.
Fl::Pen::subscribe(canvas_widget_0);
diff --git a/test/threads.cxx b/test/threads.cxx
index 4c8a94d11..466953b37 100644
--- a/test/threads.cxx
+++ b/test/threads.cxx
@@ -25,7 +25,7 @@
# include "threads.h"
# include <stdio.h>
# include <math.h>
-# include <vector>
+# include <stdlib.h>
// min. time in seconds before calling Fl::awake(...)
#define DELTA 0.25
@@ -39,9 +39,30 @@ struct prime {
Fl_Terminal *terminal; // widget to write output to
unsigned long max_prime; // highest prime found so far
Fl_Output *value; // highest prime output widget
- std::vector<unsigned long> primes; // collected primes within time frame
+ unsigned long *primes; // collected primes within time frame
+ size_t primes_count; // number of collected primes
+ size_t primes_alloc; // allocated size
};
+static void primes_init(struct prime *pr) {
+ pr->primes = 0;
+ pr->primes_count = 0;
+ pr->primes_alloc = 0;
+}
+
+static void primes_push(struct prime *pr, unsigned long n) {
+ if (pr->primes_count >= pr->primes_alloc) {
+ size_t new_alloc = pr->primes_alloc ? pr->primes_alloc * 2 : 64;
+ pr->primes = (unsigned long *)realloc(pr->primes, new_alloc * sizeof(unsigned long));
+ pr->primes_alloc = new_alloc;
+ }
+ pr->primes[pr->primes_count++] = n;
+}
+
+static void primes_clear(struct prime *pr) {
+ pr->primes_count = 0;
+}
+
Fl_Thread prime_thread;
Fl_Terminal *tty1, *tty2;
@@ -61,7 +82,9 @@ void magic_number_cb(void *p) {
void update_handler(void *v) {
char max_buf[32];
struct prime *pr = (struct prime *)v;
- for (auto n : pr->primes) {
+ size_t i;
+ for (i = 0; i < pr->primes_count; i++) {
+ unsigned long n = pr->primes[i];
pr->terminal->printf("prime: %10lu\n", n);
if (n > pr->max_prime)
pr->max_prime = n;
@@ -103,8 +126,8 @@ extern "C" void* prime_func(void* p) {
pr[0].terminal = pr[1].terminal = terminal;
pr[0].max_prime = pr[1].max_prime = 0;
pr[0].value = pr[1].value = value;
- pr[0].primes.clear();
- pr[1].primes.clear();
+ primes_init(&pr[0]);
+ primes_init(&pr[1]);
int pi = 0; // prime buffer index
Fl_Timestamp last = Fl::now();
@@ -129,7 +152,7 @@ extern "C" void* prime_func(void* p) {
if (pp > hn) { // n is a prime
- pr[pi].primes.push_back(n);
+ primes_push(&pr[pi], n);
// Send a message to the main thread, at which point it will
// process any pending updates.
@@ -140,7 +163,7 @@ extern "C" void* prime_func(void* p) {
last = Fl::now();
Fl::awake(update_handler, (void *)(&pr[pi]));
pi = 1 - pi; // switch to alternate buffer
- pr[pi].primes.clear(); // clear primes
+ primes_clear(&pr[pi]); // clear primes
}
if (n > max_value) {
diff --git a/test/unittest_core.cxx b/test/unittest_core.cxx
index c3dad3b37..75742ed80 100644
--- a/test/unittest_core.cxx
+++ b/test/unittest_core.cxx
@@ -24,32 +24,7 @@
#include <FL/filename.H>
#include <FL/fl_utf8.h>
-#include <string>
-
-
-/* Test additions to Fl_Preferences. */
-TEST(Fl_Preferences, Strings) {
- {
- Fl_Preferences prefs(Fl_Preferences::USER_L, "fltk.org", "unittests");
- prefs.set("a", std::string());
- prefs.set("b", std::string("Hello"));
- prefs.set("c", std::string("Hel\\l\nö"));
- }
- {
- Fl_Preferences prefs(Fl_Preferences::USER_L, "fltk.org", "unittests");
- std::string r;
- prefs.get("a", r, "x");
- EXPECT_STREQ(r.c_str(), "");
- prefs.get("b", r, "x");
- EXPECT_STREQ(r.c_str(), "Hello");
- prefs.get("c", r, "x");
- EXPECT_STREQ(r.c_str(), "Hel\\l\nö");
- prefs.get("d", r, "x");
- EXPECT_STREQ(r.c_str(), "x");
- }
- return true;
-}
-
+// std::string tests disabled - API to be removed
#if 0
TEST(fl_filename, ext) {
diff --git a/test/utf8.cxx b/test/utf8.cxx
index e47317026..d5e1758a6 100644
--- a/test/utf8.cxx
+++ b/test/utf8.cxx
@@ -74,7 +74,7 @@ static void cb_hide_all(Fl_Widget*, void*) {
Class for displaying sample fonts.
*/
class FontDisplay : public Fl_Widget {
- void draw(void) override;
+ void draw(void);
public:
int font, size;
@@ -455,7 +455,7 @@ class right_left_input : public Fl_Input {
public:
right_left_input(int x, int y, int w, int h)
: Fl_Input(x, y, w, h) {}
- void draw() override {
+ void draw() {
if (type() == FL_HIDDEN_INPUT)
return;
Fl_Boxtype b = box();
@@ -505,7 +505,7 @@ public:
"Only the first Unicode code point will be displayed.\n"
"Example: U+1F308 '🌈' 0x{f0,9f,8c,88}");
}
- int handle(int event) override {
+ int handle(int event) {
switch (event) {
case FL_DND_ENTER: return 1;
case FL_DND_DRAG: return 1;
@@ -513,7 +513,6 @@ public:
case FL_PASTE: {
int i, n;
const char *t = Fl::event_text();
- char temp[10];
unsigned int ucode = fl_utf8decode(t, t + Fl::event_length(), &n);
if (n == 0) {
value("");
@@ -524,35 +523,32 @@ public:
// - length = 30: "U+1F308 '🌈' 0x{f0,9f,8c,88}" -- UTF-8 encoding = 4 bytes
// - length = 31: "U+10FFFF '􏿿' 0x{f4,8f,bf,bf}" -- UTF-8 encoding = 4 bytes
//
- static const size_t max_size = 32;
// begin with first Unicode code point of Fl::event_text() in single quotes
int tl = fl_utf8len(t[0]);
if (tl < 1)
tl = 1;
- std::string buffer;
- buffer.reserve(max_size);
+ char buffer[64];
+ char *p = buffer;
// add Unicode code point: "U+0000" - "U+10FFFF" (4-6 hex digits)
- buffer += "U+";
- snprintf(temp, 9, "%04X", ucode);
- buffer += temp;
+ p += sprintf(p, "U+%04X '", ucode);
// add Unicode character in quotes
- buffer += " '";
- buffer += std::string(t, tl);
- buffer += "'";
+ memcpy(p, t, tl);
+ p += tl;
+ *p++ = '\'';
// add hex UTF-8 codes, format: "0xab" or "0x{de,ad,be,ef}"
- buffer += " 0x";
+ p += sprintf(p, " 0x");
if (n > 1)
- buffer += "{";
+ *p++ = '{';
for (i = 0; i < n; i++) {
if (i > 0)
- buffer += ',';
- snprintf(temp, 9, "%02x", (unsigned char)t[i]);
- buffer += temp;
+ *p++ = ',';
+ p += sprintf(p, "%02x", (unsigned char)t[i]);
}
if (n > 1)
- buffer += "}";
- value(buffer.c_str());
- printf("size: %lu\n", buffer.size()); fflush(stdout);
+ *p++ = '}';
+ *p = '\0';
+ value(buffer);
+ printf("size: %lu\n", (unsigned long)(p - buffer)); fflush(stdout);
}
return 1;
}
@@ -578,7 +574,7 @@ Fl_Input *iw[20]; // global widget pointers
Fl_Scroll *make_scroll(int off) {
- auto scroll = new Fl_Scroll(IW + 10, 0, SW, WH);
+ Fl_Scroll *scroll = new Fl_Scroll(IW + 10, 0, SW, WH);
int end_list = 0x10000 / 16;
if (off > 2) {
@@ -638,7 +634,7 @@ Fl_Scroll *make_scroll(int off) {
Fl_Grid *make_grid(int off) {
- auto grid = new Fl_Grid(0, 0, WW, WH); // full window size
+ Fl_Grid *grid = new Fl_Grid(0, 0, WW, WH); // full window size
grid->layout(10, 2, 5, 5); // rows, cols, margin, gap
int col_weights[] = { 100, 0 }; // resize only first column
grid->col_weight(col_weights, 2);
@@ -725,7 +721,7 @@ int main(int argc, char** argv) {
main_win = new Fl_Double_Window (WW, WH, "Unicode Display");
main_win->begin();
- auto grid = make_grid(off); // make a grid layout of widgets
+ Fl_Grid *grid = make_grid(off); // make a grid layout of widgets
// populate the grid's contents