summaryrefslogtreecommitdiff
path: root/test/table.cxx
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2017-10-17 00:28:56 +0000
committerGreg Ercolano <erco@seriss.com>2017-10-17 00:28:56 +0000
commit68f07db58aab37dac7f9eb9445f5632b1b09741a (patch)
tree581d421cc70a971035ed4bd76ecadce4843341b0 /test/table.cxx
parent93ef00cca6655c7a07aca11c53788d957097ef8f (diff)
Added Fl_Simple_Terminal widget, and mods to test+example programs (STR #3411).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12506 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test/table.cxx')
-rw-r--r--test/table.cxx18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/table.cxx b/test/table.cxx
index c36713ef5..2890895f8 100644
--- a/test/table.cxx
+++ b/test/table.cxx
@@ -16,6 +16,12 @@
#include <FL/fl_draw.H>
#include <FL/fl_ask.H>
#include <FL/Fl_Table_Row.H>
+#include <FL/Fl_Simple_Terminal.H>
+
+#define TERMINAL_HEIGHT 120
+
+// Globals
+Fl_Simple_Terminal *G_tty = 0;
// Simple demonstration class to derive from Fl_Table_Row
class DemoTable : public Fl_Table_Row
@@ -99,7 +105,7 @@ void DemoTable::draw_cell(TableContext context,
}
case CONTEXT_TABLE:
- fprintf(stderr, "TABLE CONTEXT CALLED\n");
+ G_tty->printf("TABLE CONTEXT CALLED\n");
return;
case CONTEXT_ENDPAGE:
@@ -121,9 +127,9 @@ void DemoTable::event_callback2()
int R = callback_row(),
C = callback_col();
TableContext context = callback_context();
- printf("'%s' callback: ", (label() ? label() : "?"));
- printf("Row=%d Col=%d Context=%d Event=%d InteractiveResize? %d\n",
- R, C, (int)context, (int)Fl::event(), (int)is_interactive_resize());
+ const char *name = label() ? label() : "?";
+ G_tty->printf("'%s' callback: Row=%d Col=%d Context=%d Event=%d InteractiveResize? %d\n",
+ name, R, C, (int)context, (int)Fl::event(), (int)is_interactive_resize());
}
// GLOBAL TABLE WIDGET
@@ -339,7 +345,9 @@ Fl_Menu_Item type_choices[] = {
int main(int argc, char **argv)
{
- Fl_Window win(900, 730);
+ Fl_Window win(900, 730+TERMINAL_HEIGHT);
+
+ G_tty = new Fl_Simple_Terminal(0,730,win.w(),TERMINAL_HEIGHT);
G_table = new DemoTable(20, 20, 860, 460, "Demo");
G_table->selection_color(FL_YELLOW);