Fl_Terminal widget (#800)

Pull Fl_Terminal widget from Greg's fork
This commit is contained in:
erco77
2023-11-14 07:01:52 -08:00
committed by GitHub
parent 83f6336f3b
commit 6842a43a31
35 changed files with 7818 additions and 217 deletions

View File

@@ -1,5 +1,5 @@
//
// Simple Example app using Fl_Simple_Terminal. - erco 10/12/2017
// Simple Example app using Fl_Terminal. - erco 10/12/2017
//
// Copyright 2017 Greg Ercolano.
// Copyright 1998-2016 by Bill Spitzak and others.
@@ -15,17 +15,17 @@
// https://www.fltk.org/bugs.php
//
#include <time.h> //START
#include <time.h>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Simple_Terminal.H>
#include <FL/Fl_Terminal.H>
#define TERMINAL_HEIGHT 120
// Globals
Fl_Double_Window *G_win = 0;
Fl_Box *G_box = 0;
Fl_Simple_Terminal *G_tty = 0;
Fl_Terminal *G_tty = 0;
// Append a date/time message to the terminal every 2 seconds
void tick_cb(void *data) {
@@ -43,7 +43,7 @@ int main(int argc, char **argv) {
"Your app's debugging output in tty below");
// Add simple terminal to bottom of app window for scrolling history of status messages.
G_tty = new Fl_Simple_Terminal(0,200,G_win->w(),TERMINAL_HEIGHT);
G_tty = new Fl_Terminal(0,200,G_win->w(),TERMINAL_HEIGHT);
G_tty->ansi(true); // enable use of "\033[32m"
G_win->end();
@@ -51,4 +51,4 @@ int main(int argc, char **argv) {
G_win->show();
Fl::add_timeout(0.5, tick_cb);
return Fl::run();
} //END
}