© Mike Driscoll 2018
Mike DriscollwxPython Recipeshttps://doi.org/10.1007/978-1-4842-3237-8_9

9. Drag and Drop

Mike Driscoll
(1)
Ankeny, New York, USA
 

Recipe 9-1. How to Use Drag and Drop

Problem

Most computer users of this day and age use drag and drop (DnD) instinctively. You probably used it to transfer some files from one folder to another this week! The wxPython GUI (graphical user interface ) toolkit provides DnD functionality baked in. In this recipe, we’ll see just how easy it is to implement!

Solution

wxPython provides several different kinds of drag and drop. You can have one of the following types :
  • wx.FileDropTarget
  • wx.TextDropTarget
  • wx.PyDropTarget
The first two are pretty self-explanatory . The last one, wx.PyDropTarget, is just a loose ...

Get wxPython Recipes: A Problem - Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.