I am having trouble implementing the dragging correctly in the DraggableWidget class.
They sort of drag but do not stay with the mouse. They sort of “fall behind” as the mouse
moves at approxiamtely half the rate of the mouse. It’s also a bit choppy like it’s
alternating between two coordinate systems.
The idea is that you place these widgets on a scrollable window and the virtual area
expands to accomodate the positioning of all the draggable widgets contained in it.
Coupled with a widget to display edges between two DraggableWidgets one can make
a simple interactive graph editor.
Aaargh!
Please help…
The example source is in a public dropbox link so that it doesn’t get word-wrap raped.
There is an example in the demo that shows the typical mouse event handlers needed to drag things around with the mouse. Take a look at ShapedWindow.py. It is dealing with things in screen coordinates so you'll probably need to adjust to use positions relative to your scrolled window instead. Also keep in mind that not all of the native widgets will process the low level mouse events the same as generic windows, so you may be better off making something generic that just looks like the real widget while it is being dragged around.
I am having trouble implementing the dragging correctly in the
DraggableWidget class.
They sort of drag but do not stay with the mouse. They sort of "fall
behind" as the mouse
moves at approxiamtely half the rate of the mouse. It's also a bit
choppy like it's
alternating between two coordinate systems.
The idea is that you place these widgets on a scrollable window and the
virtual area
expands to accomodate the positioning of all the draggable widgets
contained in it.
Coupled with a widget to display edges between two DraggableWidgets one
can make
a simple interactive graph editor.