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

SB app in PB webgadget?

by firace Sat Jan 20, 2018 8:59 pm

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: 117
Joined: Wed May 21, 2014 1:57 pm
Location: Netherlands

Re: SB app in PB webgadget?

by T4r4ntul4 Sun Jan 21, 2018 12:47 am

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: 552
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Re: SB app in PB webgadget?

by Peter Sun Jan 21, 2018 2:03 am

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: 12
Joined: Tue Jan 02, 2018 6:59 pm

Re: SB app in PB webgadget?

by firace Sun Jan 21, 2018 6:19 pm

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

Re: SB app in PB webgadget?

by T4r4ntul4 Sun Jan 21, 2018 9:02 pm

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

Re: SB app in PB webgadget?

by Peter Sun Jan 21, 2018 10:03 pm

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
Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest