I have try this code in my home where they are no PROXY and this time that works
Again thanks to eddy
hybrid web application : HTML5 + PB
- Kwai chang caine
- Always Here
- Posts: 5357
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: hybrid web application : HTML5 + PB
The happiness is a road...
Not a destination
Not a destination
Re: hybrid web application : HTML5 + PB
You can code a web interface and send a javascript message and make it trigger something in PB.
ARGENTINA WORLD CHAMPION
Re: hybrid web application : HTML5 + PB
Hi,
I'm just playing around with Sciter, Electron and nw.js to find if I can replace the boring PB GUI by that (at least for the GUI and encapsulating existing PureBasic stuff in DLL/SO/DYLIB). So I found your example. This is impressively easy and seems a good solution to keep an eye on.
But here on my Linux system, it does not trigger any event (but also no error messages). I only the the windows events (like #PB_Event_DeactivateWindow) but nothing from within the GUI. I'm using PB 5.46 LTS (x64) on KDE Neon (based on Ubuntu 16.04).
Also, I remember discussions that the needed WebKitGtk component is no longer available on some modern Linux distros (Fedora, Manjaro). So people will not be able to use that solution there, right? Seems the PureBasic WegGadget is not working there at all.
I'm just playing around with Sciter, Electron and nw.js to find if I can replace the boring PB GUI by that (at least for the GUI and encapsulating existing PureBasic stuff in DLL/SO/DYLIB). So I found your example. This is impressively easy and seems a good solution to keep an eye on.
But here on my Linux system, it does not trigger any event (but also no error messages). I only the the windows events (like #PB_Event_DeactivateWindow) but nothing from within the GUI. I'm using PB 5.46 LTS (x64) on KDE Neon (based on Ubuntu 16.04).
Also, I remember discussions that the needed WebKitGtk component is no longer available on some modern Linux distros (Fedora, Manjaro). So people will not be able to use that solution there, right? Seems the PureBasic WegGadget is not working there at all.
Re: hybrid web application : HTML5 + PB
eddy's example has to be modified to work with Linux because in PureBasic's WebGadget the execution of JavaScript is possibly disabled. You have to insert the following code between "If CatchXML(#xml,.." and "SmartWindowRefresh(#win, #True)" in order to check whether script execution is disabled and to enable it if yes:Kukulkan wrote:But here on my Linux system, it does not trigger any event (but also no error messages).
Code: Select all
If CatchXML(#xml, @xml$, StringByteLength(xml$)) And XMLStatus(#xml)=#PB_XML_Success And CreateDialog(#dialog) And OpenXMLDialog(#dialog, #xml, "win")
CompilerIf #PB_Compiler_OS = #PB_OS_Linux
#G_TYPE_INT = 6 << 2
ImportC ""
g_object_get_property(*Object.GObject, PropertyName.P-UTF8, *PropertyValue)
EndImport
ImportC "-lwebkitgtk-3.0"
webkit_web_view_get_settings(*WebView)
webkit_web_view_set_settings(*WebView, *WebkitSettings)
EndImport
Define WebkitSettings.I = webkit_web_view_get_settings(GadgetID(#web))
Define Value.GValue
If WebkitSettings
Value\g_type = #G_TYPE_INT
g_object_get_property(WebkitSettings, "enable-scripts", @Value)
If g_value_get_int_(@Value) = 0
g_value_set_int_(@Value, 1)
g_object_set_property_(WebkitSettings, "enable-scripts", @Value)
webkit_web_view_set_settings(GadgetID(#web), WebkitSettings)
EndIf
EndIf
CompilerEndIf
SmartWindowRefresh(#win, #True)
Re: hybrid web application : HTML5 + PB; web socket;
PWAs are on it's way to complete hopefully in 2019.
So all that very heavy electron/nw.js things get away.
node.js debugging is not so easy (WebStorm from Jetbrains does it).
Look how pgadmin is done -> web browser with client ("sitting" in systray).
It means: known, easy and powerful to use web ui and at the same time having access to local system.
pgadmin does it with AJAX-requests (slow, but hey, it's all local); I prefer web socket (more 'complex' but no/less latency).
Web socket server for PureBasic can be found here: viewtopic.php?f=12&t=61606.
So all that very heavy electron/nw.js things get away.
node.js debugging is not so easy (WebStorm from Jetbrains does it).
Look how pgadmin is done -> web browser with client ("sitting" in systray).
It means: known, easy and powerful to use web ui and at the same time having access to local system.
pgadmin does it with AJAX-requests (slow, but hey, it's all local); I prefer web socket (more 'complex' but no/less latency).
Web socket server for PureBasic can be found here: viewtopic.php?f=12&t=61606.
Vivaldi; hybrid web application : HTML5 + PB
https://vivaldi.com
This web browser can be extremly tailored until no browser ui remains.
Window then looks like a native application.
This web browser can be extremly tailored until no browser ui remains.
Window then looks like a native application.