On Tue, Jul 03, 2007 at 08:45:10PM +0200, matthiasm wrote:

> Please put a "break;" statement at the end of the "case" line.
> 
> ... your last line should be
> 
>    return Box::handle(event);

Thanks for this, but sadly it makes no difference.  I'm still seeing
no ENTER events and a LEAVE event whenever the pointer leaves the box
*or* the window.  (Latest version is attached.)  So I'm still stumped;
I can't get ENTER events.  Is there anything else I can try?

Regards, 

Jeremy Henty 
#include <stdio.h>

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>

class Box : public Fl_Box {
public:
  Box(int x, int y, int w, int h) :
    Fl_Box(x,y,w,h) {
    box(FL_FLAT_BOX);
    color(FL_WHITE);
  }
  virtual int handle(int);
};

int Box::handle(int ev) {
  switch (Fl::event()) {
  case FL_ENTER: printf("ENTER\n"); break;
  case FL_LEAVE: printf("LEAVE\n"); break;
  }
  return Fl_Box::handle(ev);
}

int
main(int argc, char **argv) {
  Fl_Window *window = new Fl_Window(300,300,"Enter/Leave");
  window->begin();
  new Box(50,50,200,200);
  window->end();
  window->show(argc,argv);
  return Fl::run();
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to