0

I managed to find a sample code for Images as described in the following link .

How to drag images with pygtk

However when I use it for a button doesn't seem to work .

3
  • 'Use it for a button'? Do you mean you want to drag the button, or use the button to drag the image?
    – jcoppens
    May 16, 2015 at 23:12
  • I want to add it for a button .
    – Deepak N
    May 18, 2015 at 15:00
  • Please include your code in the question. Jun 13, 2015 at 6:50

1 Answer 1

0

What the original link does:

It moves (pans) the image inside a 'Scrolled Window' widget. The widget doesn't change places, only the image with respect to the widget.

If you want to move the button itself, that is more complicated! It is easier if you use the 'fixed' layout manager, where the buttons are located in absolute coordinates (as opposed to the 'normal' layout manager where all widgets are 'packed' alongside each other. There you should use drag and drop. You have to prepare the entire application for 'receiving' the button, and what to do with it when it gets there. This involves many steps! ).

Have a look at the gtk.Fixed widget's documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.