SB app in PB webgadget?

Everything else that doesn't fall into one of the other categories.
firace
Posts: 28
Joined: Tue Jan 02, 2018 6:59 pm

SB app in PB webgadget?

Post by firace »

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?
User avatar
T4r4ntul4
Posts: 132
Joined: Wed May 21, 2014 1:57 pm
Location: Netherlands
Contact:

Re: SB app in PB webgadget?

Post by T4r4ntul4 »

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
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: SB app in PB webgadget?

Post by Peter »

Here's a little testimonial I wrote in the german PureBasic-Forum about this topic (Translated with http://www.DeepL.com/Translator):
My 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.
Greetings ... Peter
firace
Posts: 28
Joined: Tue Jan 02, 2018 6:59 pm

Re: SB app in PB webgadget?

Post by firace »

OK, thanks for sharing the results of your testing. Good to know. :)
User avatar
T4r4ntul4
Posts: 132
Joined: Wed May 21, 2014 1:57 pm
Location: Netherlands
Contact:

Re: SB app in PB webgadget?

Post by T4r4ntul4 »

If the built-in browser in PB was better, it would work together?
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: SB app in PB webgadget?

Post by Peter »

T4r4ntul4 wrote:If the built-in browser in PB was better, it would work together?
PureBasic uses the browser provided by the respective operating system. This is Internet Explorer for Windows and WebKit for Linux.

If PureBasic would also use WebKit for Windows, the result would be much better.

Greetings ... Peter
Post Reply