WebUI wrapper
Re: WebUI wrapper
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?
Do I need to install a specific browser?
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: WebUI wrapper
The website is dynamically. It fits the window.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 ?
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
@jacdelad
You have to download WebUI
Inside are the libs.
You have to download WebUI

Inside are the libs.
Re: WebUI wrapper
Thank you infratec!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'
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>
"Daddy, I'll run faster, then it is not so far..."
Re: WebUI wrapper
Very nice, thank you.
How to show it direct in a browser (for example Chrome) without a extra own window?
How to show it direct in a browser (for example Chrome) without a extra own window?
my live space
-
- Addict
- Posts: 1264
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: WebUI wrapper
The WebUI binaries don't seem to be available. Does anyone have the Windows zip?
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: WebUI wrapper
You may download compiled binaries for Windows x64 from this official link of the stable version.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?
-
- Addict
- Posts: 1264
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: WebUI wrapper
Thank you.Shardik wrote: Mon Jul 24, 2023 8:55 pmYou may download compiled binaries for Windows x64 from this official link of the stable version.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?
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
-
- Addict
- Posts: 1264
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: WebUI wrapper
Would there be any way to hide the WebUI window?
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Re: WebUI wrapper
I had a similar problem until I put "webui-2-x64.dll" in my dev folder.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 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.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: WebUI wrapper
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
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
Simon White
dCipher Computing
dCipher Computing
Re: WebUI wrapper
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 :
I can use the following and everything works correctly.
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")
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)
Simon White
dCipher Computing
dCipher Computing
Re: WebUI wrapper
This is actually very nice. Thanks. I assume we can build GUI's in Spiderbasic and use them in PB?
-
- New User
- Posts: 4
- Joined: Fri Aug 25, 2023 10:29 pm
Re: WebUI wrapper
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.
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.
-
- New User
- Posts: 4
- Joined: Fri Aug 25, 2023 10:29 pm
Re: WebUI wrapper
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.