Page 2 of 3

Re: WebUI wrapper

Posted: Mon Jun 12, 2023 1:35 pm
by jacdelad
Ok, I seem to be the only one with this problem: "File not found: 'webui-2-x64.lib'"
Do I need to install a specific browser?

Re: WebUI wrapper

Posted: Mon Jun 12, 2023 1:40 pm
by infratec
Fred wrote: Mon Jun 12, 2023 10:47 am What do you mean by website ? You control all the UI as you are the only one to create it or I miss something ?
The website is dynamically. It fits the window.
Maybe you use a complete javascript editor and simply start the index.html file without modifications.

I would like to setup the window before.

But the developer already want to add this.

@dige
WebUI is primary for own UserInterfaces build in html and javascript.
You can try to build an own file with iframe inside, but most websites don't allow this anymore.
To avoid 'hijacking'

Re: WebUI wrapper

Posted: Mon Jun 12, 2023 1:41 pm
by infratec
@jacdelad
You have to download WebUI :wink:
Inside are the libs.

Re: WebUI wrapper

Posted: Mon Jun 12, 2023 2:06 pm
by dige
infratec wrote: Mon Jun 12, 2023 1:40 pm @dige
WebUI is primary for own UserInterfaces build in html and javascript.
You can try to build an own file with iframe inside, but most websites don't allow this anymore.
To avoid 'hijacking'
Thank you infratec!

I've created a file 'ui\MainWindow.html' - it works! Fun fact: Webui always takes the browser I last used. I happened to have tested it after Firefox and Brave (Chrome) respectively.

Code: Select all

<!DOCTYPE html>
<html>
<head>
    <title>WhatsMyBrowser.org</title>
    <style>
        body, html {
            margin: 0;
            padding: 0;
            height: 100%;
            overflow: hidden;
        }
        
        iframe {
            width: 100%;
            height: 100%;
            border: none;
        }
    </style>
</head>
<body>
    <iframe src="https://www.whatsmybrowser.org" title="WhatsMyBrowser"></iframe>
</body>
</html>

Re: WebUI wrapper

Posted: Mon Jul 24, 2023 2:03 pm
by nicolaus
Very nice, thank you.
How to show it direct in a browser (for example Chrome) without a extra own window?

Re: WebUI wrapper

Posted: Mon Jul 24, 2023 8:42 pm
by Seymour Clufley
The WebUI binaries don't seem to be available. Does anyone have the Windows zip?

Re: WebUI wrapper

Posted: Mon Jul 24, 2023 8:55 pm
by Shardik
Seymour Clufley wrote: Mon Jul 24, 2023 8:42 pm The WebUI binaries don't seem to be available. Does anyone have the Windows zip?
You may download compiled binaries for Windows x64 from this official link of the stable version.

Re: WebUI wrapper

Posted: Tue Jul 25, 2023 12:27 pm
by Seymour Clufley
Shardik wrote: Mon Jul 24, 2023 8:55 pm
Seymour Clufley wrote: Mon Jul 24, 2023 8:42 pm The WebUI binaries don't seem to be available. Does anyone have the Windows zip?
You may download compiled binaries for Windows x64 from this official link of the stable version.
Thank you.

Re: WebUI wrapper

Posted: Tue Jul 25, 2023 1:05 pm
by Seymour Clufley
Would there be any way to hide the WebUI window?

Re: WebUI wrapper

Posted: Tue Jul 25, 2023 2:40 pm
by skywalk
jacdelad wrote: Mon Jun 12, 2023 1:35 pm Ok, I seem to be the only one with this problem: "File not found: 'webui-2-x64.lib'"
Do I need to install a specific browser?
I had a similar problem until I put "webui-2-x64.dll" in my dev folder.
I thought it would work with the static lib alone?
PB v603b3 CBE wrote:---------------------------
PureBasic_Compilation0.exe - System Error
---------------------------
The code execution cannot proceed because webui-2-x64.dll was not found. Reinstalling the program may fix this problem.

Re: WebUI wrapper

Posted: Fri Jul 28, 2023 9:36 pm
by swhite
Hi

I downloaded and tested your example and it works well. I then tried to create a web page in VS Code and saved the file but when I use window_show(my_window , "htm\myfile.html") the windows shows my html but Purebasic exists a few seconds later instead of waiting. The documentation says to add: <script src="/webui.js"></script> to your html files but I cannot find webui.js and wondered if that is why Purebasic is not working with my html page.

Any suggestions would be appreciated.

Simon
infratec wrote: Mon Jun 12, 2023 1:41 pm @jacdelad
You have to download WebUI :wink:
Inside are the libs.

Re: WebUI wrapper

Posted: Wed Aug 02, 2023 2:23 pm
by swhite
Hi

It turns out that the project has moved to using TypeScript so webui.js is now webui.ts. However, I found that rather than using :

Code: Select all

  webui_show(window,"htm\dCFusnTCPG.htm")
I can use the following and everything works correctly.

Code: Select all

If ReadFile(0,"htm\dCFusnTCPG.htm")
   lcHtm = ReadString(0,#PB_Ascii | #PB_File_IgnoreEOL)
   CloseFile(0)
Else
   lcHTM = ~"<!DOCTYPE html><html lang=\"en\"><head><title>Error</title></head><body>Unable to load file></body></html>"
EndIf   
webui_show(window, lcHtm)

Re: WebUI wrapper

Posted: Wed Aug 09, 2023 11:07 am
by AndyMK
This is actually very nice. Thanks. I assume we can build GUI's in Spiderbasic and use them in PB?

Re: WebUI wrapper

Posted: Fri Aug 25, 2023 10:35 pm
by himogec152
The repo for PureBasic-WebUI is here: https://github.com/webui-dev/purebasic-webui
I found the link to this forum in the readme file. However, the repo is not working, somebody needs to finish it...
I tested the Python one and it's working fine.

Re: WebUI wrapper

Posted: Fri Aug 25, 2023 10:43 pm
by himogec152
By looking at Python examples (https://github.com/webui-dev/python-web ... -editor/ui) I noticed that webui.js file does not need to exist locally, it is a virtual file so.