Technical communication is welcome !
全部博文(1)
2013年(1)
分类: LINUX
2013-12-22 19:47:14
#include
#include
#include
class Hello : public Fl_Window
{
public:
Hello(int w, int h);
~Hello();
private: // Don't touch my draw
void draw();
};
Hello::Hello(int w, int h) : Fl_Window(w, h)
{
this->end();
}
Hello::~Hello()
{
}
void Hello::draw()
{
int iW = 0;
int iH = 0;
const char* pszText = "Hi FLTK, I'm coming !";
fl_font(0, 40);
fl_measure(pszText, iW, iH);
fl_rectf(0, 0, w(), h(), FL_BLACK);
fl_color(FL_GREEN);
fl_draw(pszText, w() / 2 - iW / 2, h() / 2 + iH / 2);
}
int main(int argc, char *argv[])
{
Hello hello(640, 480);
hello.show();
return Fl::run();
}