Drag images in richtext

I’m using the wx.RichTextCtrl to make a Rich text editor, I’m using the wxPython version 2.8.8.1. My doubt is, How can I drag images in RichTextCtrl widget?
I tried this Way:

*Take a reference to the RichTextImage when I click.

  • Remove the image:
    ParentParagraph.RemoveChild(image)
  • Insert the image in new position
    MyRichtext.WriteImage(image.GetImage())

But the problem is, How could I get the new insertion pointj based on the mouse position?

Thanks.

Thiago Franco Moraes wrote:

I'm using the wx.RichTextCtrl to make a Rich text editor, I'm using the wxPython version 2.8.8.1 <http://2.8.8.1>. My doubt is, How can I drag images in RichTextCtrl widget?
I tried this Way:

*Take a reference to the RichTextImage when I click.
* Remove the image:
ParentParagraph.RemoveChild(image)
* Insert the image in new position
MyRichtext.WriteImage(image.GetImage())

But the problem is, How could I get the new insertion pointj based on the mouse position?

HitTest(point) returns a 2-tuple of flags and the insertion point.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks

···

On Tue, Sep 2, 2008 at 4:20 PM, Robin Dunn robin@alldunn.com wrote:

HitTest(point) returns a 2-tuple of flags and the insertion point.