webui-dev / nim-webui Goto Github PK
View Code? Open in Web Editor NEWUse any web browser as GUI, with Nim in the backend and HTML5 in the frontend.
Home Page: https://webui.me
License: MIT License
Use any web browser as GUI, with Nim in the backend and HTML5 in the frontend.
Home Page: https://webui.me
License: MIT License
I am using latesed cloned webui4nim and webui. I have copied webui\include\*.h
to this webui4nim
So I can generated hello_world.exe in MSYS2+Mingw64 on my windows 10 64bits with just nim c -r hello_world.nim
hello_world.exe can be lauched. However, no matter what password is used, when I click "check password", it crashed. But as we know, some message should be printed in MSYS2 console
When I tried to test the examples, I manually cloned this repo, but because of nim.cfg
, the compiling failed.
C:\Users\...\webui-main\examples>nim c -d:useWebviewStaticLib call_nim_from_js.nim
Hint: used config file 'C:\Nim\config\nim.cfg' [Conf]
Hint: used config file 'C:\Nim\config\config.nims' [Conf]
Hint: used config file 'C:\Users\...\webui-main\examples\nim.cfg' [Conf]
............................................................................................
C:\Users\...\webui-main\webui\bindings.nim(76, 12) Error: cannot find: ./webui/src/mongoose.c
Copying the example folder outside of the repo folder will work. Also, just removing nim.cfg
works too.
Regular cloning (nonrecursive) tries to rebuild webui.c
instead of using the already installed one.
Similar to #5 , I went into some crashes when working with hello_world.nim
using Nimble package.
In devel mode it crashes silently when clicked, in release mode it works but sometimes it still crashes.
I tried to change webui.nim:261
from
data = buffer.join().strip(leading = false, chars = {'\x00'})
to
data = $(cast[cstring](addr buffer[0]))
Then it seems to work smoothly, with thread:off
. Not tested much and not using nightly build, but I want to note it here for others who is willing to make further investigations about it.
My env: Nim Compiler Version 1.6.12 [Windows: amd64]
It would be very useful if we could get and set the window size and position. Can we expect this functionality to be available soon?
for example
https://github.com/olifolkerd/tabulator
https://github.com/jspreadsheet/ce
further, is it possible to interface 3rd javascript code without writing any js code?
thanks
It would be cool to have some kind of "bindJS
" template, where it takes the given Nim code and transpiles it to JS to then binds the generated JS code to the id.
The next version 2.4.0
will include TLS Encryption between the GUI and the Nim application. This will make compiling WebUI from the source more challenging for the Nim wrapper.
I suggest making the Nim wrapper using the static pre-built library which makes things very easy as it does not need to compile WebUI from the source.
tcc: error: library 'ws2_32' not found
Possibly related to #2
I am on OSX (M1) Ventura 13.3, nim 1.6.10, nimble 0.13.1
I can do nimble install webui
without error, but not track it as a dependency in my project.
If I add this to my nimble file:
requires "https://github.com/neroist/webui.git"
or:
requires "webui >= 0.2.1"
I get this, when I try to nimble run
:
/Users/konsumer/.nimble/pkgs/webui-0.2.1/webui/webui/src/mongoose.c:20:10: fatal error: 'mongoose.h' file not found
#include "mongoose.h"
^~~~~~~~~~~~
As a new user trying to understand the state of this library, the commit messages have been a significant impediment. The six most recent commit messages are indicative of the difficulty.
updateee
beta
event
at procs
submodule
.
Commit messages that summarize what has changed and why would be greatly appreciated. The article How to Write a Git Commit Message might be a useful guide to follow.
Hello, how would i use this with a javascript framework such as reactjs or svelte?
See this: webui-dev/webui#109
I tried to do as I was advised by @AlbertShown, or rather change the path imports of all js/and css scripts in the html file to out/path instead of path, but it had exactly no effect.
Error receiving script files for current html
But this script's located right
Right now my page looks like this when I export HTML from React through NextJS
But it should be like this:
Exported this page to github pages is: https://griffith1deady.github.io/languages
Minimal code for error is:
import std/os, webui
var window: Window
proc main =
window = newWindow(1)
window.runtime = NodeJs
window.show("languages.html")
wait()
setCurrentDir(currentSourcePath().parentDir() & "/out")
main()
All source files with pages & resources, more precisely exporting my site https://github.com/griffith1deady/griffith1deady.github.io packed in an archive:
NIM.zip
Also, you may notice some visual differences between my resources and those on the work site: all this is because I just used earlier commits.
Do I think something is just blocking the distribution of files?
I am using nim in MSYS2+MINGW64 on windows 10 64 bits. I installed webui via nimble install webui
$ nim --version
Nim Compiler Version 1.9.3 [Windows: amd64]
Compiled at 2023-06-16
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: 77beb152141f0efe4d5c93b784e42f973ba46551
active boot switches: -d:release
I can compile
when I try and run nim-webui-main\examples\hello_world.nim
without problem. But for nim-webui-main\examples\text_editor\src\text_editor.nim
, I get
C:\tmp\candel\src\text_editor.nim(43, 21) Error: undeclared field: 'rootFolder=' for type we
bui.Window [type declared in C:\Users\USER\.nimble\pkgs2\webui-2.3.0.1-4945446001c8ab19a5f
9fbcbf1d771b9da4a324e\webui.nim(13, 3)]
I suggest removing the website
folder and keep it only in the webui
repo, because it has the FTP auto deploy so we can have only one official online documentation that has all the APIs.
Why did you choose MIT License? Is there any benefit over the GPL one?
I suggest we keep all repos in the same version. For example, WebUI is now on v2.3.0
, so all repo releases should be on the same version v2.3.0
. And if any bug fix happens only on that repo, then we publish 2.3.0.1
, 2.3.0.2
etc... I did that with Go and Python so I can easily know what version of the WebUI library is used.
WebUI v2.2.0 is ready for release.
Big changes:
webui.h
it's become more straightforward and smaller and optimized for wrapper creationwebui_show()
will replace webui_open()
and webui_new_server()
webui_window_t
struct becomes a simple void*
webui_script()
webui.h
To create the new Nim wrapper, run c2nim webui.h
. And remove all other functions from the old version v2.1.1.
After that, we will start creating more big software in Nim as an example (Text editor, Media Player, Database viewer...), which will be very exciting to explore and learn new things!.
If you have any questions, please don't hesitate to ask me here.
Thank you for maintaining the WebUI Nim wrapper. I appreciate it ๐
Trying to run examples to get familiar with the webui
hello_world.nim generates this EM:
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
fish: Job 1, './test' terminated by signal SIGSEGV (Address boundary error)
Running Nim version 1.6.12 and webui 0.5.0
Failing with nimble install (stable and git versions), nimble develop and git recursive too
I started using your library. It's quite nice, but i have a problem. I tried to create an image gallery. If the images are in the main app folder(where the exe file is) or, starting from the main app folder, in a sub folder they are shown. If instead the images are in another folder the images don't appear. How can i solve this problem? I cannot put all the images in the app folder. I tried to use file:// protocol and also ../../ relative path but nothing works
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.