I installed FLTK 1.3.X from fltk.org on my visual studio 2012 compiler and use PPP book for C++ programming (this). My problem is about filling a Shape in. For example please observe this code:
#include <Simple_window.h>
using namespace Graph_lib;
int main()
{
Simple_window win(Point(100,100), 1000, 600, "Binary_tree");
Graph_lib::Circle c(Point(200,200),50);
c.set_color(Color::red);
c.set_fill_color(Color::blue);
Graph_lib::Ellipse e(Point(100,100),50,30);
e.set_color(Color::blue);
e.set_fill_color(Color::red);
Graph_lib::Rectangle r(Point(250,200),Point(350,300));
r.set_color(Color::green);
r.set_fill_color(Color::red);
win.attach(r);
win.attach(e);
win.attach(c);
win.wait_for_button();
}
When I run the program, All three Shapes
are drawn on window but only the Rectangle
is filled in!
Why?
set_color
works for the three and apparently the set_fill_color
is defined for all Shapes
and it too should work but why it doesn't for Circle
and Ellipse
?
This is the .CPP
and .h
files ( )