Matthias Melcher wrote in [fltk.general] Fl_Widget::show course a app crash:

 > I am not even sure if 1.1.9 can have an Overlay Window as a sub window.

At least it doesn't crash. I tested with test/subwindow.cxx by deriving 
the testwindow class from Fl_Overlay_Window instead of Fl_Window. The 
only thing I had to do beyond the obvious was to define 
testwindow::draw_overlay() as an _empty_ method.

The modified program ran as usual. Would it make a difference with a 
real draw_overlay() method? Is this what you don't know if it works, or 
do we need to test with a real draw_overlay() method?

svn diff (FLTK 1.1.10-svn) attached (inline)

Albrecht

$ svn diff
Index: subwindow.cxx
===================================================================
--- subwindow.cxx       (revision 6870)
+++ subwindow.cxx       (working copy)
@@ -34,6 +34,7 @@
  #include <stdio.h>
  #include <FL/Fl.H>
  #include <FL/Fl_Window.H>
+#include <FL/Fl_Overlay_Window.H>
  #include <FL/Fl_Toggle_Button.H>
  #include <FL/Fl_Menu_Button.H>
  #include <FL/Fl_Box.H>
@@ -66,17 +67,18 @@
    else return 0;
  }

-class testwindow : public Fl_Window {
+class testwindow : public Fl_Overlay_Window {
    int handle(int);
    void draw();
    int cx, cy; char key;
    Fl_Cursor crsr;
  public:
    testwindow(Fl_Boxtype b,int x,int y,const char *l)
-    : Fl_Window(x,y,l), crsr(FL_CURSOR_DEFAULT) {box(b); key = 0;}
+    : Fl_Overlay_Window(x,y,l), crsr(FL_CURSOR_DEFAULT) {box(b); key = 0;}
    testwindow(Fl_Boxtype b,int x,int y,int w,int h,const char *l)
-    : Fl_Window(x,y,w,h,l) {box(b); key = 0;}
+    : Fl_Overlay_Window(x,y,w,h,l) {box(b); key = 0;}
    void use_cursor(Fl_Cursor c) { crsr = c; }
+  void draw_overlay() {}; // *** empty draw_overlay() method ***
  };

  void testwindow::draw() {

Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to