Comments (14)
Hey ! I never thought of having a canvas in neutrino, but that should be possible I think. I am not sure what is the problem in what you have. First, are the provided examples working ? Second, you can add .set_debug()
to your window in order to get the right click and the code inspector.
from neutrino.
Well, if we have access to a canvas, then we can basically do anything. Yes, the examples work well (except for the contrast, because I use a dark theme but that's a separate thing).
I didn't know about .set_debug()
, I'll try it and see what goes wrong.
from neutrino.
I have added .set_debug()
to the hello_world
demo and used the inspector. When I right click and select `Inspect Element' nothing happens the first time. The second time, I get this window:
Sometimes it will rerender the window, and I lose the right click menu. So unfortunately it doesn't help me. Btw, this also happens with my widget.
from neutrino.
Weird that it does not work with hello_world
. I just tried it with set_debug()
I get the right result :
Seems that your issue is that you have a tag mismatch... Could you try displaying the whole evaluated html ? Maybe you'll see where the issue is ?
from neutrino.
When I say "display" I mean using println! in the render()
function of Window
from neutrino.
I added println!("{}", rendered);
to the render()
function of Window
:
render("<div id=\"app\"><style type=\"text/css\"></style><canvas id=\"my_graph\" width=\"500\" height=\"500\"></canvas>
<script>
var canvas = document.getElementById('my_graph');
var context = canvas.getContext('2d');
context.beginPath();
context.moveTo(100, 20);
context.lineTo(200, 160);
context.lineWidth = 5;
context.strokeStyle = 'blue';
context.stroke();
</script></div>")
But like I said, I have very little experience with HTML, CSS, and other web related stuff, so maybe I'm doing something very wrong here.
from neutrino.
It seems okay to me :/ I'll try it tomorrow ;)
from neutrino.
Ah, I checked the console output and I see a looooot of output, and at the end an error:
from neutrino.
Oh yes, it is because the render JavaScript function cannot take as an input a string containing line breaks. I need to work on this :/
from neutrino.
I see. So I changed the the html section to one string without line breaks, and I don't get that error anymore. It still doesn't work though, and the inspection gives the same error as in the picture I posted before.
Maybe it's related to the web-view
crate.
from neutrino.
@GuzTech : I now have the same error as you with webkit... Are you using Archlinux ? Have you found how to solve it ?
from neutrino.
Sorry for the late reply. Yes I'm running Arch. I haven't looked into solving this issue, so unfortunately no :'(
from neutrino.
I just updated my packages, webkit2gtk is now 2.26.2-1, and the inspector seems to be working :D
from neutrino.
I can confirm that the inspector is working! However, the context menu after right-clicking appears only once, so if I misclick, then the menu does not appear anymore.
from neutrino.
Related Issues (20)
- Make the Keyboard shortcuts implementation better HOT 1
- Keyboard navigation HOT 1
- Using native html elements when possible / Keyboard nav
- UI should not be selectable unless it is tagged so HOT 4
- Using stdweb for widgets HOT 1
- Suggestion: Applying Rustfmt HOT 2
- Scrollable view HOT 2
- [Question]: write html and attach events to rust from it. HOT 2
- JSX like syntax? HOT 1
- Blurry interface on Windows HOT 6
- Charts widget
- cargo test fails HOT 4
- TextInput resets itself HOT 3
- How do I create a frameless/tiltlebarless window? HOT 5
- Text color issue when desktop is in darkmode HOT 1
- Am I blind or how do I build the `neutrino` app mentioned in the wiki examples HOT 4
- failed to run custom build command for `webview-sys v0.1.4`
- Keep app in foreground when lost focus HOT 1
- I don't have time anymore for this project HOT 1
- How to close right-click、Disabled back reload
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 neutrino.