On 29/11/13 09:39, michael wrote: > I have written a small project which is intended to test editing an html page > (I would like to create a wysiwyg markdown editor). I have attached a copy. I > am having trouble with editing the html programattically > (http://gambasdoc.org/help/comp/gb.qt4.webkit/webview?v3, using the Eval > method to run the JavaScript document.execCommand). I have copied the > relevant code from the supplied WebBrowser project, and sending the Cut > command works in the WebBrowser project but not in mine. Sending the Bold or > Delete command does work in mine, using the keyboard to edit the html does > work in mine (eg Ctrl C, typing etc.). > I am using Debian 7 Gnome, with Gambas 3.4.1 which I installed from source > (the repo version 3.1.1 is too old for another program I have written). > Any Ideas ? > > Thank you > Michael. > No reply yet, it has been a while ?? But I have found the solution, by going through the WebBrowser example and commenting out the lines I didn't need, one line or Sub at a time. What is needed was the line
WebSettings[WebSettings.JavascriptCanAccessClipboard] = True in the Form_Open() Sub. This allows me to click on the cut button which executes the command document.execCommand('Cut', false, false) This makes sense, since the WebView help page says "using the Eval method to run the JavaScript document.execCommand)" however it isn't stated on the WebView help page that you need to enable this. I think that such a statement would be a good idea. Michael ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user