mirror of
https://github.com/fltk/fltk.git
synced 2026-05-30 21:25:30 +08:00
Remove unneeded strdup from example, fold tabs
This commit is contained in:
@@ -31,7 +31,6 @@
|
|||||||
#include <FL/Fl_Input.H>
|
#include <FL/Fl_Input.H>
|
||||||
#include <FL/fl_draw.H>
|
#include <FL/fl_draw.H>
|
||||||
#include <FL/Fl_Table.H>
|
#include <FL/Fl_Table.H>
|
||||||
#include <FL/fl_string.h> // fl_strdup()
|
|
||||||
|
|
||||||
void button_cb(Fl_Widget *w, void*);
|
void button_cb(Fl_Widget *w, void*);
|
||||||
|
|
||||||
@@ -76,7 +75,8 @@ public:
|
|||||||
} else {
|
} else {
|
||||||
// Create the light buttons
|
// Create the light buttons
|
||||||
sprintf(s, "%d/%d ", r, c);
|
sprintf(s, "%d/%d ", r, c);
|
||||||
Fl_Light_Button *butt = new Fl_Light_Button(X,Y,W,H,fl_strdup(s));
|
Fl_Light_Button *butt = new Fl_Light_Button(X,Y,W,H);
|
||||||
|
butt->copy_label(s);
|
||||||
butt->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
|
butt->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
|
||||||
butt->callback(button_cb, (void*)0);
|
butt->callback(button_cb, (void*)0);
|
||||||
butt->value( ((r+c*2) & 4 ) ? 1 : 0);
|
butt->value( ((r+c*2) & 4 ) ? 1 : 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user