From 68f07db58aab37dac7f9eb9445f5632b1b09741a Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Tue, 17 Oct 2017 00:28:56 +0000 Subject: 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 --- test/table.cxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'test/table.cxx') 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 #include #include +#include + +#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); -- cgit v1.2.3