views:

177

answers:

2

Do you know if there is an easy way to drag-and-drop elements (icons or buttons) into a canvas and create different drawings on it as a result?

The idea is to have a set of objects and let the user drag them into a drawing space.

In the worst case the user could just click on the icon/button, and then click on the canvas and draw the element in the position, but I think the dragging is more intuitive.

A: 

There is an example of something more or less like this here: http://wiki.wxpython.org/wxOGL Although it is about wxOGL, they recommend you to use either SimpleCanvas or FloatCanvas and adapt their examples.

relima
+1  A: 

I assume you are building a browser app? If so, the jQuery UI Droppable plugin provides most of the standard functionality, and is pretty easy to modify to fit custom needs. Here's the link: http://jqueryui.com/demos/droppable/

vonkohorn