FLTK logo

[fltk.general] Re: Updating program to 1.4.x

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Updating program to 1.4.x Rob McDonald May 24, 2021  
  Sorry, posted before I was done writing the message...

On Monday, May 24, 2021 at 11:41:03 AM UTC-7 Rob McDonald wrote:
I am in the process of updating my program to work with the 1.4 branch (specifically  working from commit cbee4880f45c).  I've been on the 1.3 branch happily, and am finally testing the 1.4 waters...

There are a handful of things that have popped up so far.

In at least one case so far, 1.4 is more sensitive to a bug in our use of it, so it is helping us find some problems.

I have an extension of Fl_Button to support drag-n-drop.  I do this...

int MyButton::handle(int event)
{
  int ret = Fl_Button::handle(event);
  switch ( event ) {
    case FL_DRAG:
      if( callback() )
      {
        do_callback();
      }
      ret = 1;
      break;

    default:
      break;
  }
  return ret;
}


So the Fl_Button do_callback() is wired up to capture FL_DRAG.  The callback gets passed along to my class that contains the pointer to the MyButton...  We'll call that a ButtonHolder.  It handles the event with this code...

void ButtonHolder::DeviceCB( Fl_Widget* w )
{
  if ( w == m_Button ) // m_Button is the pointer to the MyButton
  {
    switch ( Fl::event() ) {
      case FL_DRAG:
        Fl::copy( m_Foo.c_str(), m_Foo.size(), 0 );
        Fl::dnd();

        break;

      case FL_RELEASE:
        if( Fl::event_inside( w ) )
        {
          // Do something else.
        }

        break;

      default:
        break;
    }
  }
}
 

The problem is -- every time a FL_DRAG event is started, the FL_RELEASE event immediately triggers (even before a button release).  This only happens on MacOS, it does not happen on Windows.  This code worked fine on 1.3.X.

Any ideas why Clicking and holding (drag hasn't even started) on MacOS would trigger a Release event?

Thanks,

Rob

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/b02540c1-f9e0-4834-9537-892ff2544693n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.