[Gambas-user] Dragging to Webview?; HttpClient.Delete()?; & Embedder missing

Bruce Steers bsteers4 at gmail.com
Thu Jul 29 09:24:00 CEST 2021


On Thu, 29 Jul 2021 at 08:05, Bruce Steers <bsteers4 at gmail.com> wrote:

> I just tried the following code...
>
>
>
> *Public Sub WebView1_Drop()    Print Drag.DataEnd*
>
>
> Drag-drop files from my computer to the application window woks completely
> as expected.
> result was...
> *file:///home/bonus/Desktop/IconActionEd.desktop*
>
> Not sure why it doesn't work for you?
>
> BruceS
>


Note:
QT adds more to the drag.data separated by CR \r so needs cleaning up..
I used *Print Quote(Drag.Data)*  to discover exactly what text QT was
giving me and found it gave \r chars.

So to clean up the data, remove the 'file://' part and be compatible with
gtk and qt webview use something like this...


*Public Sub WebView1_Drop()  Dim sTrimmed As String = Replace(Drag.Data,
"file://", "")  *' remove 'file://'
*  Dim iPos As Integer = InStr(sTrimmed, "\r")   *' look for carriage return
*  If iPos Then sTrimmed = Mid(sTrimmed, 1, iPos - 1) * ' get text left of
first \r if one exists (QT)



*  Print "'"; sTrimmed; "'"End*
Hope that helps
BruceS




> On Wed, 28 Jul 2021 at 23:52, Cam Era <cybercamera at gmail.com> wrote:
>
>> Lee,
>>
>> did you find a solution to this problem below? Or any other way to get
>> file-uploads working in Webview? If so, care to share?
>>
>> Cheers
>>
>> On Fri, Jan 31, 2020 at 5:19 AM T Lee Davidson <t.lee.davidson at gmail.com>
>> wrote:
>>
>>> 1. I am unable to drag files to an active Webview. For instance, when
>>> viewing a page with a form that has a <input type="file">
>>> element, I should be able to drag and drop a file from the system file
>>> manager onto the file input element. I cannot.
>>>
>>> The mouse drag cursor remains red, never turns green, to indicate that
>>> the file cannot be dropped on the Webview control. I have
>>> Webview.Drop=True if that makes any difference.
>>>
>>> Is there something I need to do to get Webview to accept drops from the
>>> system? Or is this just the nature of the beast?
>>>
>>>
>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210729/6df94f04/attachment.htm>


More information about the User mailing list