Need help implementing bind for C for webview.h

2021-04-21 Thread shirleyquirk
started in embedded C. my C++ is a work in progress; unfortunately I found this other, nicer proglang to use and it's sort of hampered my development.

Need help implementing bind for C for webview.h

2021-04-21 Thread francisl
Thanks, merged it and its working perfectly. where did you get the skills needed? Did you previously work in C/C++?

Need help implementing bind for C for webview.h

2021-04-21 Thread shirleyquirk
i made another PR to silence the linking issue on osx if that helps but maybe I should just try to work on webview myself if i want it so much lol

Need help implementing bind for C for webview.h

2021-04-21 Thread shirleyquirk
yes! splitting webview.h properly into .cpp and .h is the real solution to avoid all the multiple definitions

Need help implementing bind for C for webview.h

2021-04-21 Thread francisl
Anyway, now I have linker issue, my knowledge of compiled language can't make me far enough. I was able to get going with wails in 10 minutes last night, so I'll use it to my experiment for the moment. So I'll declare forfeit for the time being, and come back to it when I have more time learn.

Need help implementing bind for C for webview.h

2021-04-21 Thread francisl
Maybe that changed, but gtk was never a really good cross platform library. Look and feel, breaking keyboard defaults etc. The original webkit.h already handle the use of the right windowing depending of the platform : You can see

Need help implementing bind for C for webview.h

2021-04-21 Thread drkameleon
Coincidentally, I've been working on something similar lately in a PR. Have a look if you want:

Need help implementing bind for C for webview.h

2021-04-21 Thread JPLRouge
I removed the option inject css and set_font, this is done directly in the html page. on the other hand i process json in Nim main program. The Json aspect is only useful to me to communicate data, so what Nim does it well ... and not in C as in your example. (Afterwards, it's a matter of taste,

Need help implementing bind for C for webview.h

2021-04-21 Thread JPLRouge
Hello, interesting your return. I had two goals the first was to make a real connection with webview.h and how to work it as well as the communication with Nim. It taught me a lot, on the other hand you must have seen that I only took into account Linux and I took the option of having three sepa

Need help implementing bind for C for webview.h

2021-04-20 Thread francisl
Hey, About the version, I wrote that based on the information I have on the webview main git repo. If you look at all the functions they deprecated from 0.1.1 to 0.10.0, you still use the header with those. eg. `inject_css` not in the new version

Need help implementing bind for C for webview.h

2021-04-20 Thread Clonk
You can `const_cast` arguments when interfacing with C++ to solve this issue . Here is an example : func data*(self: CppString): ptr cchar {.importcpp: "const_cast(#.data())".} Run

Need help implementing bind for C for webview.h

2021-04-20 Thread JPLRouge
hello, no I do not use the old version, I said that on my system there is only gtk3, gtk4 is not ported to XFCE4 Manjaro, but it is the same for the use of webview.h

Need help implementing bind for C for webview.h

2021-04-20 Thread shirleyquirk
oh golly but your bindCProc is a closure! that shouldn't work, how is that working

Need help implementing bind for C for webview.h

2021-04-20 Thread shirleyquirk
i can replicate that error with clang, but gcc works.

Need help implementing bind for C for webview.h

2021-04-20 Thread francisl
Thank for the answers. Sadly I'm still stuck with another error. Trouble for me, is my lack of understanding of C/C++ is dragging me down. TBH, I can't really comment on the error message. How I read it, I just don't understand why it can't match the function. For example, with the current cha

Need help implementing bind for C for webview.h

2021-04-19 Thread shirleyquirk
omg even more infuriating when {.cdecl.} and {.nimcall.} are identical on every target other than win32. even there i've got my doubts. {.cdecl.} must die.

Need help implementing bind for C for webview.h

2021-04-19 Thread shirleyquirk
ah yes you also need to define your bindCproc to match the WebviewCb type, i should have mentioned proc bindCProc(sequ:cstring, req:cstring, arg: pointer) {.exportc,cdecl.} = let idx = cast[int](arg) ... Run theres no benefit to using the c backend i was ju

Need help implementing bind for C for webview.h

2021-04-19 Thread francisl
Thanks, I didn't saw it. But from what I read, it's for GTK only and it's also using the old version.

Need help implementing bind for C for webview.h

2021-04-19 Thread Clonk
Have you taken a look at ? I believe it is based on webview as well It was announced in a forum thread

Need help implementing bind for C for webview.h

2021-04-19 Thread francisl
Thanks for the answer. Sadly I can't get that compiled either. /webview/examples/minimal/minimal.nim(12, 2) Error: type mismatch: got but expected one of: proc connect(w: Webview; name: cstring; fn: WebviewCb) first type mismatch at position: 3 required type for

Need help implementing bind for C for webview.h

2021-04-19 Thread shirleyquirk
i also managed to get your example to compile with the c backend, it's an utter hack and of dubious use. but hey: in the config file define: gcc.exe = "g++" gcc.linkerexe = "g++" -passC:-fpermissive #to allow converting char* to const char* Run and change the

Need help implementing bind for C for webview.h

2021-04-19 Thread shirleyquirk
the `void* arg` is for the user callback to be able to take an argument. it's `void*` so it can be of any type. the `void* arg` is for the user callback to be able to receive a parameter, it's `void*` so it can be any type, the user callback then casts it to the type it needs you're getting an

Need help implementing bind for C for webview.h

2021-04-19 Thread francisl
Hi, A couple of month back I tried to make the webview work for Nim against the new version. () The implementation link on the page use the old version, which is buggy and terribly slow, and is not upgradable. I had the basic working fine, but now if I want