■ Drag and drop and clipboard events are very similar, both use the meta-object wx.DataObject to mediate data formats. Default data objects exist for text, files, and bitmaps, but custom formats can be created. In using the clipboard, the global object wx.TheClipboard manages the data transfer and represents the underlying system clipboard.
■ For a drag and drop operation, the drag source and drag target work together to manage the data transfer. The drag source event blocks until the drag target rules on whether the drag operation is valid.
■ The wx.Timer class allows you to set events to happen at a set time in the future or periodically. The timer class can be explicitly set to trigger ordinary wxPython events, or one of a couple of wrapper functions can be used.
■ Threading in wxPython is possible, but it's very important to make sure that all GUI activity takes place in the main thread. You can use the function wx.CallAfter() to manage interthread communication.
Was this article helpful?