GTKWindow

Helper class to open a GTK window and draw to it

Constructors

this
this()
Undocumented in source.

Members

Functions

clearWindow
void clearWindow()
draw
void draw(T gg, int width, int height)
run
void run(string title, int width, int height)

Open the window and run the mainloop. This is blocking, due to the mainloop.

Static variables

sa
SurfaceArea sa;
Undocumented in source.

Examples

// Code to create the aes here
// ...

// Start gtk window.
const width = 470;
const height = 470;
auto gd = new GTKWindow();
auto tid = new Thread(() { gd.run("plotcli", width, height); }).start();
auto gg = GGPlotD().put( geomHist2D( aes ) );
gd.draw( gg, width, height );
Thread.sleep( dur!("seconds")( 2 ) ); // sleep for 5 seconds

gg = GGPlotD().put( geomPoint( aes ) );
gd.clearWindow();
gd.draw( gg, width, height );

// Wait for gtk thread to finish (Window closed)
tid.join();

Meta