> On the drag-n-drop issue, I did a little work on that yesterday too, but
> did not get very far (had promised to help a friend install his new,
> very much bigger, lathe in his workshop...)
>
> What I found was that the code seems to be getting into MACpreparedrag()
> and then croaking, but I did not get any chance to investigate why...
>
> A little bit of the code is clipped below:
>
>
> int MACpreparedrag(void)
> {
>    CFDataRef text =3D CFDataCreate(kCFAllocatorDefault, (UInt8*)=20
> fl_selection_buffer[0], fl_selection_length[0]);
>    if (text=3D=3DNULL) return false;
>    NSAutoreleasePool *localPool;
>    localPool =3D [[NSAutoreleasePool alloc] init];
>    NSPasteboard *mypasteboard =3D [NSPasteboard =20
> pasteboardWithName:NSDragPboard];
>    [mypasteboard declareTypes:[NSArray arrayWithObjects:@"public.utf8-=20
> plain-text", nil] owner:nil];
>    [mypasteboard setData:(NSData*)text forType:@"public.utf8-plain-=20
> text"];
>    CFRelease(text);
>    Fl_Widget *w =3D Fl::pushed();
>    Fl_Window *win =3D w->window();
>    while(win->window()) win =3D win->window();
>
> .... This seems to be as far as we get before it dies...

Could it be that your palette is nothing more than a window
with nothing inside? Fl::pushed() would return the window,
w->window() would return NULL,
and while(win->window()) would crash on dereferencing a NULL pointer.

This would be corrected by:
  Fl_Widget *w = Fl::pushed();
  Fl_Window *win = w->window();
  if(win == NULL) { win = (Fl_Window*)w; }
  else { while(win->window()) win = win->window(); }

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

Reply via email to