It is currently Sun Dec 15, 2019 10:46 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: hybrid web application : HTML5 + PB
PostPosted: Sat Mar 10, 2018 7:25 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4548
Location: Lyon - France
I have try this code in my home where they are no PROXY and this time that works
Again thanks to eddy 8)

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
 Post subject: Re: hybrid web application : HTML5 + PB
PostPosted: Thu May 24, 2018 1:08 am 
Offline
Addict
Addict
User avatar

Joined: Fri Apr 25, 2003 7:06 pm
Posts: 2244
Location: Argentina
You can code a web interface and send a javascript message and make it trigger something in PB.


Top
 Profile  
Reply with quote  
 Post subject: Re: hybrid web application : HTML5 + PB
PostPosted: Wed Oct 24, 2018 10:38 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1223
Location: germany
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: hybrid web application : HTML5 + PB
PostPosted: Wed Oct 24, 2018 8:43 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Apr 21, 2005 2:38 pm
Posts: 1658
Location: Germany
Kukulkan wrote:
But here on my Linux system, it does not trigger any event (but also no error messages).
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:
Code:
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)
After the insertion of this CompilerIf..CompilerEndIf block the WebGadget events are also triggered on Linux and eddy's example works like a charm (tested successfully with Linux Mint 18.3 x64 PB 5.46 x64 with GTK3 in ASCII and Unicode mode) if for your distribution webkitgtk-3.0 is still available.


Top
 Profile  
Reply with quote  
 Post subject: Re: hybrid web application : HTML5 + PB; web socket;
PostPosted: Sat Dec 29, 2018 8:45 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 19, 2010 3:42 am
Posts: 540
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: https://www.purebasic.fr/english/viewtopic.php?f=12&t=61606.


Top
 Profile  
Reply with quote  
 Post subject: Vivaldi; hybrid web application : HTML5 + PB
PostPosted: Sun Feb 03, 2019 12:39 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 19, 2010 3:42 am
Posts: 540
https://vivaldi.com

This web browser can be extremly tailored until no browser ui remains.
Window then looks like a native application.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye