webui-dev / webui

Use any web browser or WebView as GUI, with your preferred language in the backend and modern web technologies in the frontend, all in a lightweight portable library.
https://webui.me
MIT License
2.63k stars 157 forks source link

Is it possible to create threads with extra functions? #254

Closed skinkairewalker closed 9 months ago

skinkairewalker commented 9 months ago

Is it possible to create threads with extra functions? From the tests I did, the base application is closed and the webui is opened outside the main application, however the thread is forcibly killed...

Is that exactly what I understood, or am I wrong?

hassandraga commented 9 months ago

The UI can still open after backend closes only if it fails to connect to the backend application. Don't forget that the UI (web browser) is completely a separated process. However, Can you please add more details and test code about the thread issue?

skinkairewalker commented 9 months ago

Well, I would like to create a webview for my web game... however I want to publish it on Steam, so I want to leave the Steam API running in the backend to ensure there is no fraud or piracy...

Would it be possible to add these features?

Well, I'm a bit stupid, but where can I find an example of connecting to the backend?

hassandraga commented 9 months ago

I would like to create a webview

I would like to clarify that WebUI it's not a WebView. Let me explain.

The WebView project uses and embed the operating system webview controller into your application, and it needs the webview runtimes to be installed on the end-user to make your program runs. The whole UI is embedded in your program.

The WebUI project (this repo) uses any installed web browser as UI. so your program (backend) needs just a web browser to run. No runtimes is needed. The UI is completely a separated process.

where can I find an example of connecting to the backend?

To connect UI to the backend, simply add webui.js to your UI HTML.

Documentation: https://webui.me/docs/2.4.0/#/

Examples: https://github.com/webui-dev/webui/tree/main/examples

hassandraga commented 9 months ago

You can still mix WebView and WebUI in one project if you like too. But to help you better, we may need first what programming language you are using and if you can share some simple codes that will help us understand your main issue better.

skinkairewalker commented 9 months ago

I would like to create a webview

I would like to clarify that WebUI it's not a WebView. Let me explain.

The WebView project uses and embed the operating system webview controller into your application, and it needs the webview runtimes to be installed on the end-user to make your program runs. The whole UI is embedded in your program.

The WebUI project (this repo) uses any installed web browser as UI. so your program (backend) needs just a web browser to run. No runtimes is needed. The UI is completely a separated process.

where can I find an example of connecting to the backend?

To connect UI to the backend, simply add webui.js to your UI HTML.

Documentation: https://webui.me/docs/2.4.0/#/

Examples: https://github.com/webui-dev/webui/tree/main/examples

awesome !! But it's still possible to make a "client" for my game, right?

You can still mix WebView and WebUI in one project if you like too. But to help you better, we may need first what programming language you are using and if you can share some simple codes that will help us understand your main issue better.

im using c++

hassandraga commented 9 months ago

Sure you can, just check out the C++ example and the C++ documentation.

Please let me know If you have any issue/question.

skinkairewalker commented 9 months ago

thanks by u support 💯