On 04/13/13 14:47, testalucida wrote:
> can someone explain, what's wrong with this code? There's no FL_DRAG event 
> upcoming in the Box class:

        The docs for the FL_DRAG event will tell you why:

        Under the section "Mouse Events":

    In order to receive FL_DRAG events, the widget must return non-zero
    when handling FL_PUSH.

        So add this one line to your handle() method:

                if (evt == FL_PUSH) rc = 1;

        Or, just rewrite the handle() method with a switch(), ie:

int handle(int evt) {
    int rc = Fl_Box::handle(evt);
    switch (evt) {
        case FL_PUSH: rc=1; break
        case FL_DRAG: printf("Dragging..\n"); rc=1; break;
    return rc;
fltk mailing list

Reply via email to