mirror of
https://github.com/fltk/fltk.git
synced 2026-02-06 00:01:57 +08:00
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user