<div dir="ltr"><div class="gmail_default" style="font-size:small">I added a CursorFrom() method to TextArea in the attached project.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you drop the TextArea.class file into your project then it adds to all TextArea controls the method..</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">TextArea1.CursorFrom(X as Integer, Y As Integer) As Integer</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I called it CursorFrom() because it compliments CursorAt()<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Should work with any font.<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The attached project has a test prog that lists $HOME in an IconView, dragging files to the TextArea inserts filenames at drop position.</div><div class="gmail_default" style="font-size:small"></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Respects</div><div class="gmail_default" style="font-size:small">BruceS</div><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 13 Nov 2023 at 21:01, T Lee Davidson <<a href="mailto:t.lee.davidson@gmail.com">t.lee.davidson@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 11/13/23 12:05, T Lee Davidson wrote:<br>
> I've tried with Tracking turned off (as it is not needed) and getting the Mouse.X/Y coordinates in the Drop event, but the <br>
> values are inconsistent.<br>
<br>
Further, I've come up with simple Drop event code that I think /might/ work, but I cannot verify it because setting <br>
TextArea.Line crashes the program when using gb.gtk3. I can't test the algorithm with Qt either because no drag or drop events <br>
fire. With gb.qt5 it just, simply, works.<br>
<br>
Note: This code requires the use of a monospace font for the TextArea.<br>
[code]<br>
Public Sub TextArea1_Drop()<br>
<br>
  Â TextArea1.Line = Min(TextArea1.Line, Int((Mouse.ScreenY - TextArea1.ScreenY) / TextArea1.Font.Height))<br>
  Â TextArea1.Column = Min(TextArea1.Column, Int((Mouse.ScreenX - TextArea1.ScreenX) / TextArea1.Font.TextWidth(" ")))<br>
<br>
  Â TextArea1.Insert(Drag.Data)<br>
<br>
End<br>
[/code]<br>
<br>
<br>
-- <br>
Lee<br>
<br>
<br>
----[ <a href="http://gambaswiki.org/wiki/doc/netiquette" rel="noreferrer" target="_blank">http://gambaswiki.org/wiki/doc/netiquette</a> ]----<br>
</blockquote></div>