-1

I have an OSX widget written using Dashcode.

Currently any mouse drag event causes the entire widget to move on the desktop.

I wish to be able to click and drag within a canvas on that widget, but I don't seem to be able to prevent the OSX dashboard from moving the entire widget instead.

I'm already capturing mouse movements quite happily, but the click/drag combo is defeating me.

Alnitak
  • 334,560
  • 70
  • 407
  • 495
  • Di you ever resolve this? I have been looking at it and cannot find any way of dragging and dropping in a widget and i cannot find any examples or instances of it either. My feeling from reading about how a widget is instantiated on the desktop is that it is not possible (unless you have solved it?) – PurplePilot Oct 21 '10 at 12:22

1 Answers1

1

I've apparently found the answer, here in the Apple Developer site.

Put a -apple-dashboard-region: style on the div that you want to have receive drag events instead of dragging the widget, e.g.:

#canvas {
    -apple-dashboard-region: dashboard-region(control rectangle 4px 4px 4px 4px);
}

EDIT - this works - I can now capture onMouseMove() events when when the mouse button is pressed.

One thing I can't (yet) do is the equivalent of IE's setCapture(), where mouse movement events continue to be passed to the application even when the drag extends beyond the area of the widget.

Alnitak
  • 334,560
  • 70
  • 407
  • 495
  • does it? anyone tried it (i will at the weekend) but the doc say "Specifiying a control region means that if a user attempts to drag a widget from within a specified region, the drag will not occur and the widget will not move." This just means the widget itself will not move but doesn't mean that you can actually drag, although i suspect you can. – PurplePilot Nov 09 '10 at 20:49