Is it possible to use another cross platform web gadget?

Everything else that doesn't fall into one of the other PB categories.
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Is it possible to use another cross platform web gadget?

Post by Kukulkan »

Hi,

I have the need to use the WebGadget for displaying stuff in our cross platform tools. But sadly, I struggle with the PureBasic WebGadget:

1) I have to save all content to files first, because SetGadgetItemText() works only on Windows.
2) GetGadgetItemText() seems the only option to get some information out. But only works on Windows.
3) Navigation callback only works on Windows. Really missing that...
4) Linux and Mac showing border around the gadget, Windows not. I can enable on WIndows using API, but I can't disable for Linux and MacOS. At least, I found no reliable way.
5) Looks like the PB WebGadget is broken on some more recent Linux Distributions. Or at least, it gets harder to find working distributions (see forum). So I have more support cost on such systems (users ask us how to make our software run).

In general, I'm missing control over the gadget itself and what happens inside.

I thought about embedding of Gecko, but Mozilla dropped support: https://developer.mozilla.org/en-US/doc ... ding_Gecko
WebKit seems very complicated to me.

Would be really great if there was a library (dll, so and dylib) which allows to create own web-render gadgets and control that in more detail.

Any ideas?

[update]Maybe BLINK is an option? http://www.chromium.org/blink It is the rendering engine of Chromium, Opera etc.[/update]
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Is it possible to use another cross platform web gadget?

Post by wilbert »

Setting html code directly should work on MacOS as well.

Maybe CEF (Chromium Embedded Framework) would also be an option.
Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: Is it possible to use another cross platform web gadget?

Post by Kukulkan »

wilbert wrote:Maybe CEF (Chromium Embedded Framework) would also be an option.
Sound interesting. I will have a look!
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Is it possible to use another cross platform web gadget?

Post by the.weavster »

This looks like it could be interesting.
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: Is it possible to use another cross platform web gadget?

Post by chi »

idle did some tests with webview a few weeks ago...
Et cetera is my worst enemy
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: Is it possible to use another cross platform web gadget?

Post by Mistrel »

chi wrote:idle did some tests with webview a few weeks ago...
Note that while the interface is cross-platform, each platform uses its own native renderer and therefore may display pages differently.
User avatar
idle
Always Here
Always Here
Posts: 5049
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Is it possible to use another cross platform web gadget?

Post by idle »

The webview gadget just has the added ability to inject js and css, so you can call Js functions
and have js functions call PB functions.
As far as html5 support goes it's still limited. Importing cef would be easy enough but it's seriously large
an other alternative would be scitter, though it's not MIT.

After looking into the issue I decided the easiest way to go was to use an embedded http server and at my clients request
I made it an in memory embedded http / https server which can then be used to serve to a web gadget or the local browser.
You then have the choice to use a JS framework with ajax or do server side preprocessing of the html.
I'm currently looking at doing the server side preprocessing but am still trying to decide on how to tag the html
to do replacements from callbacks.
See Civet_Server thread
viewtopic.php?f=27&t=70995
or git
https://github.com/idle-PB/pb_civet_server
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Is it possible to use another cross platform web gadget?

Post by Shardik »

Kukulkan wrote:I have the need to use the WebGadget for displaying stuff in our cross platform tools. But sadly, I struggle with the PureBasic WebGadget:

1) I have to save all content to files first, because SetGadgetItemText() works only on Windows.
2) GetGadgetItemText() seems the only option to get some information out. But only works on Windows.
3) Navigation callback only works on Windows. Really missing that...
Several time I have already tried to help you out with implementing some of the missing WebGadget functions for MacOS or Linux. To combine all these efforts I have posted 2 cross-platform examples which demonstrate how to implement a navigation callback and these 4 important WebGadget functions:
- GetGadgetItemText(#WebGadget, #PB_Web_HTMLCode)
- GetGadgetItemText(#WebGadget, #PB_Web_PageTitle)
- GetGadgetItemText(#WebGadget, #PB_Web_SelectedText)
- SetGadgetItemText(#WebGadget, #PB_Web_HTMLCode, HTML$)

By the way, although SetGadgetItemText(#WebGadget, #PB_Web_HTMLCode, HTML$) is documented to only work on Windows, it also seems to work fine on MacOS... :wink:
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: Is it possible to use another cross platform web gadget?

Post by Kukulkan »

Hello Shardik,

I know and I already use these in our products. Thank you for the combination! But for Linux, the Webgadget starts to make problems because on some distros it seems broken (see discussions here in the forum). Users with Windows Explorer 11 can not print (a Windows bug which is not becoming fixed on Windows 7) and I still found no way to disable the border on all target OS (Win, Lin and Mac).

So I thought that some replacement would be better. We did the same by using libcurl directly because the PB implementation is not sufficient (especially SSL/TLS smtp and some other things around keeping connections open). But some external webgadget is around 150MB (compressed) and this is very much!

Anyway, I will try again to workaround all the limitations.
Post Reply