Comments (21)
webui 7.zip please see attach lazarus project , it is not working no feedback
I see three main problems at first glance: 1. In Lazarus, you need to create a project of the "simple program" type; 2. In the project parameters, set the target processor family to x86_64, since the library webui.dll - 64 bit; 3. When installing the hook, the name is case sensitive, in your case it is myid and MyID, you need to bring them to the same denominator
from pascal-webui.
if you could share working example
First we need to update pascal wraper to the latest version of the library and only then write an example for Lazarus/Delphi based on it.
I'll take care of it.
from pascal-webui.
we need to update pascal wraper to the latest version of the library
updated the wrapper version to library version 2.4.0, I'll try to do an example on the weekend
thanks Delphius , we would like to ask you to add the sample if you are free
from pascal-webui.
Thank you @delphius for reporting this. Please open two issues. One for Yandex browser, and another for the headless mode.
About the pre-built libs, @ttytm implemented a nice CI to auto build and generate binaries when a new stable release tagged. For now, you should build the lib from source using any C99 compiler (No other dependencies are needed).
If you want to save time, this is my latest build in debug
mode, so you can copy the logs from your terminal.
webui-2.zip
from pascal-webui.
program project1;
{$mode objfpc}{$H+} uses {$IFDEF UNIX} cthreads, {$ENDIF} Classes,WebUI,Dialogs,Interfaces { you can add units after this };
var window: size_t;
procedure EventHandler(e: Pwebui_event_t);
begin
//writeln('Received callback: ', e^.data);
ShowMessage('hello');
end;
begin
window := webui_new_window; webui_show(window, '1.html');
webui_bind(window, 'myid', @EventHandler);
webui_wait;
end
from pascal-webui.
doesnt work
What error message do you see?
Can you use an example to see if it's working?
from pascal-webui.
no error message , it just nothing happen when i press the button
from pascal-webui.
No errors when you use your code, I see. And what about the example? Any errors?
from pascal-webui.
no , can you modify my code and show message/show dialog when you press a button
from pascal-webui.
You should use webui_bind()
before webui_show()
.
program project1;
{$mode objfpc}{$H+} uses {$IFDEF UNIX} cthreads, {$ENDIF} Classes, WebUI, Dialogs, Interfaces { you can add units after this };
var window: size_t;
procedure EventHandler(e: Pwebui_event_t);
begin
// writeln('Received callback: ', e^.data);
ShowMessage('hello');
end;
begin
window := webui_new_window;
webui_bind(window, 'myid', @EventHandler);
webui_show(window, '1.html');
webui_wait;
end
from pascal-webui.
webui 7.zip
please see attach lazarus project , it is not working
no feedback
from pascal-webui.
webui 7.zip please see attach lazarus project , it is not working no feedback
I see three main problems at first glance: 1. In Lazarus, you need to create a project of the "simple program" type; 2. In the project parameters, set the target processor family to x86_64, since the library webui.dll - 64 bit; 3. When installing the hook, the name is case sensitive, in your case it is myid and MyID, you need to bring them to the same denominator
this all has been considered , but still not working , if you could share working example , ie press on the button showmessage
thanks
from pascal-webui.
we need to update pascal wraper to the latest version of the library
updated the wrapper version to library version 2.4.0, I'll try to do an example on the weekend
from pascal-webui.
we need to update pascal wraper to the latest version of the library
updated the wrapper version to library version 2.4.0, I'll try to do an example on the weekend
thanks Delphius , we would like to ask you to add the sample if you are free
from pascal-webui.
we need to update pascal wraper to the latest version of the library
updated the wrapper version to library version 2.4.0, I'll try to do an example on the weekend
thanks Delphius , we would like to ask you to add the sample if you are free
@hassandraga, I usually have a Yandex browser running, so webui selects it to launch the window, I looked at the mechanism in the source codes of the library. When testing a new version of the library, such a thing happens, if the Yandex browser is running, then webui_show
simply opens windows Explorer in the folder C:\Users
and that's it. If you unload Yandex, the library loads chrome by default and everything is ok. I haven't checked other browsers yet, there's no time.
if necessary, I can open the issue, but first I would like to understand if this is really a library error or something else.
And one more thing, pascal wrapper is already for 2.4.0, and in releases you can download dll only for 2.3.0. I downloaded 2.4.0 in the discussions and use the current dll in the examples, but I think not everyone will be able to figure it out, the main problem is that there is no backward compatibility for key structures, for example Pwebui_event_t, so it is very important to use the correct version of the binary library
And one more question, we use webui
in headless mode to test pages from pascal, while in order to load the pages themselves, we have to use tricks such as this one:
webui_show(Window, '<!DOCTYPE html><html><head></head><body><script>function loadData(){fetch("linktosomehost.com").then(response=>response.text()).then(content=>{document.open("text/html");document.write(content);document.close()}).catch(error=>{console.error(error);});}window.onload=loadData;</script></body></html>');
to let webui
to load the necessary library code on the browser side to serve events and websocket and it can be also done by dom manipulating.
I certainly understand the true purpose of the library, but since the possibility of working in headless mode has already been implemented, maybe we should think about a more efficient way of working in this mode?
from pascal-webui.
we need to update pascal wraper to the latest version of the library
updated the wrapper version to library version 2.4.0, I'll try to do an example on the weekend
thanks Delphius , we would like to ask you to add the sample if you are free
thanks delphius , could we use showmessage instead of writeln?
from pascal-webui.
thanks delphius , could we use showmessage instead of writeln?
these are just training examples, if the output goes to the console, then it is better to output to the console, otherwise you will have to pull the entire lcl behind you to connect dialogs
from pascal-webui.
thanks delphius , could we use showmessage instead of writeln?
these are just training examples, if the output goes to the console, then it is better to output to the console, otherwise you will have to pull the entire lcl behind you to connect dialogs
yes actually i had done that , but when i press it didnt show message
from pascal-webui.
yes actually i had done that , but when i press it didnt show message
wouldn't it be easier then to use the usual lazarus form instead of the console?
from pascal-webui.
yes actually i had done that , but when i press it didnt show message
wouldn't it be easier then to use the usual lazarus form instead of the console?
the idea is to mix the beauty of HTML5 & CSS and the power of fpc and lcl , like using printers , reports , dialogs ....etc
from pascal-webui.
Im closing this as everything is working. Sample project provided is invalid, element IDs are case sensitive.
from pascal-webui.
Related Issues (9)
- webui_interface_set_response HOT 1
- How to use WebUi as replacement for Microsoft Webview2 ? HOT 5
- type no defined HOT 14
- webui-2.dll HOT 1
- MacOS test on a real machine HOT 2
- Delphi not working HOT 4
- Can you modify it and support delphi? HOT 2
- Binding to an Html event and returning element value HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pascal-webui.