下面是 patch
diff -ruN fltk-1.1.7-old/src/Fl_x.cxx fltk-1.1.7-new/src/Fl_x.cxx
--- fltk-1.1.7-old/src/Fl_x.cxx 2008-02-27 17:08:14.000000000 +0800
+++ fltk-1.1.7-new/src/Fl_x.cxx 2008-02-27 17:02:04.000000000 +0800
@@ -761,6 +761,10 @@
     if (Fl::first_window()->non_modal() && window != Fl::first_window())
       Fl::first_window()->show();
 #  endif
+    window->damage(FL_DAMAGE_EXPOSE, xevent.xexpose.x, xevent.xexpose.y,
+           xevent.xexpose.width, xevent.xexpose.height);
+    event = FL_EXPOSE;
+    break;

   case GraphicsExpose:
     window->damage(FL_DAMAGE_EXPOSE, xevent.xexpose.x, xevent.xexpose.y,
diff -ruN fltk-1.1.7-old/FL/Enumerations.H fltk-1.1.7-new/FL/Enumerations.H
--- fltk-1.1.7-old/FL/Enumerations.H    2008-02-27 17:15:17.000000000 +0800
+++ fltk-1.1.7-new/FL/Enumerations.H    2008-02-27 17:00:26.000000000 +0800
@@ -56,6 +56,7 @@
 typedef unsigned long ulong;

 enum Fl_Event {    // events
+  FL_EXPOSE        = 24,
   FL_NO_EVENT        = 0,
   FL_PUSH        = 1,
   FL_RELEASE        = 2,

下面是 sample source code
#include
#include
#include    // cout

class FL_EXPORT MyWindow : public Fl_Window
{
private:
    int handle(int e);
public:
    // CONSTRUCTOR
    MyWindow(int X,int Y,int W,int H,const char*L=0) : Fl_Window(X,Y,W,H,L) { };
};

int MyWindow::handle(int e)
{
    Fl_Window::handle(e);
    switch(e)
    {
        case FL_EXPOSE:
            cout << "expose alert." << endl;
        break;
        default:
        break;
    }
}

int main()
{
    MyWindow win(100, 100, 200, 100);
    win.show();
    return Fl::run();
}

創作者介紹

邱小新の工作筆記

台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()