Frank Millman wrote:
Hi all,
The attached program shows a frame with a panel and a wxTreeCtrl.
Drag and drop is enabled. A test is performed to see if the drop area is
valid. If not, a MessageDialog is displayed and nothing is updated. For this
sample program, all drops are treated as invalid.The problem is that, under GTK (1 & 2), you cannot close the MessageDialog
with the mouse - you have to press Enter on the keyboard. MSW does not show
this problem.I have included displaying a MessageDialog under normal circumstances as
well. This works correctly, so it is definitely connected with DnD.
Robin Dunn wrote:
The tree captures the mouse during the drag and so it can't be used
within the dialog window until after the DnD has been completed. Using
a wx.CallAfter to show the dialog takes care of the problem:def OnEndDrag(self,evt):
wx.CallAfter(self.ShowDlg)def ShowDlg(self):
dlg = wx.MessageDialog(self.panel, 'Not allowed',
'Error', wx.OK | wx.ICON_ERROR)
dlg.ShowModal()
dlg.Destroy()
Thanks, Robin, this works a treat. I should have tried that myself - sorry about that.Frank