Is it possible to compile an SB app and run it in the PB webgadget (in a Windows exe)?
Has anyone managed to do that?
SB app in PB webgadget?
Re: SB app in PB webgadget?
hi, you mean like this?: this is PB code: Its not working. too many script errors.
Code: Select all
If OpenWindow(0, 0, 0, 600, 300, "SB in PB webgadget test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
WebGadget(0, 10, 10, 580, 280, "https://timelinegen.dppro.nl/")
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Re: SB app in PB webgadget?
Here's a little testimonial I wrote in the german PureBasic-Forum about this topic (Translated with http://www.DeepL.com/Translator):
Greetings ... PeterMy goal was to run a SpiderBasic project as a desktop application and to enable websocket communication with PureBasic. The whole thing should work on Windows, Linux and MacOS without major reprogramming. This is what I have tried:
PureBasic + WebGadget:
As expected, programming under Windows is tormented by the Internet Explorer used in the WebGadget. Without making changes in the registry (create browser emulation and disable "click"sound) and Windows-Api (to suppress annoying javascript error messages) you won't get far. And even then, for example, SpiderBasic's ListIconGadget does not work as expected (list entries can only be selected by keyboard; with the mouse, you just move the focus).
Also meager 302 of 555 points on https://html5test.com/ do not promise anything good. The communication between SpiderBasic and PureBasic via Websocket did not work. According to "Can I use..." the IE 11 should support Websocket communication.
Under Linux, on the other hand, the whole thing made a better impression (no wonder, as WebKit is used here). Only the Javascript support had to be activated. But what use is the good impression under Linux if it falls off so much under Windows.
Java (FX) + WebKit:
With the help of B4J I made a window with an inner WebView (based on WebKit). That was very simple. The resulting JAR runs smoothly on both Windows and Linux (provided the corresponding Java version is installed). Communication via Websocket works. I particularly liked the small size of the JAR of nearly 400 KB. With 353 out of 555 points on html5test.com, WebKit outperforms IE a little better.
Addendum: I just created a JAR with Netbeans (without the B4J overhead). Now the file size is about 2 KB!
NodeJs + Electron
The ultimate in functionality. Chromium is used here, which is then promptly reflected with a proud 518 out of 555 points at html5test. com. An internal parallel running web server (express), which provides the files statically, is realized with three lines of program code. As expected, web socket communication between PB and Electron ran smoothly. The Chromium's built-in developer console allows convenient debugging. The electron-packager creates binaries that run out-of-the-box on all major operating systems (even if you don't have the appropriate OS). Unfortunately, the application built with Electron is not exactly small. One has to reckon with just under 150 MB per installation.
Re: SB app in PB webgadget?
OK, thanks for sharing the results of your testing. Good to know.
Re: SB app in PB webgadget?
If the built-in browser in PB was better, it would work together?
Re: SB app in PB webgadget?
PureBasic uses the browser provided by the respective operating system. This is Internet Explorer for Windows and WebKit for Linux.T4r4ntul4 wrote:If the built-in browser in PB was better, it would work together?
If PureBasic would also use WebKit for Windows, the result would be much better.
Greetings ... Peter