-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add hyperlink in ui and text example #568
base: main
Are you sure you want to change the base?
Conversation
crates/wasm/Cargo.toml
Outdated
ambient_project = { path = "../../shared_crates/project" } | ||
ambient_shared_types = { path = "../../shared_crates/shared_types", features = [ | ||
"native", | ||
] } | ||
|
||
webbrowser = "0.8.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a good idea to use open
, which we have a workspace dep for. Not sure if it'd be a security risk, though - does open::that("explorer.exe")
work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a good idea to use
open
, which we have a workspace dep for. Not sure if it'd be a security risk, though - doesopen::that("explorer.exe")
work?
open
works.
I am not on Windows so I am not sure of the latter. Isn't that
only used for URL? https://docs.rs/open/latest/open/
) -> Element { | ||
crate::prelude::Button::new(&url.clone(), move |world| { | ||
println!("Opening url {}", &url); | ||
let link = Entity::new().with(hyperlink(), url.clone()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth adding a function for this instead of an entity. That would also allow us to return an error if we find the thing that's being opened to be invalid/questionable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth adding a function for this instead of an entity. That would also allow us to return an error if we find the thing that's being opened to be invalid/questionable.
I tried before to call webbrowser
here but get a 'wbindgen_placeholder' error. That's why I have to send to the world and watch it. Perhaps we can do the check there and then decide whether we want to open it or not?
--- edit
cannot put open
here as well. so it has to communicate with backend?
2023-07-07.09-00-18.mp4