-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Examples: async request no blocking main thread #1578
Examples: async request no blocking main thread #1578
Conversation
Thanks a lot for your contribution, please send a PR to add the needed dependencies to https://github.com/gtk-rs/gtk4-rs/blob/master/Dockerfile. But before doing so, the other option is to disable the default features of reqwest and use |
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.
overall looks good, few things though:
- Add a readme for the example
- The gif example is nice, but please record just the application window without anything else (to reduce the size) and using a light default theme to match all the other examples. The current gif is too large (1.18mb).
- Please rename the gif to something like
screenshot.gif
- Add the example to the main
examples/README.md
c8479b4
to
7c5f1ea
Compare
examples/tokio_async_request/main.rs
Outdated
pub fn new() -> Self { | ||
Self { page: 0 } | ||
} |
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.
You could derive Default and use that instead
examples/tokio_async_request/main.rs
Outdated
@@ -0,0 +1,107 @@ | |||
use glib::clone; | |||
use gtk::glib::once_cell::sync::Lazy; |
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.
We are removing once_cell usage from our crates, so you should use std::sync::OnceLock here instead
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.
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.
I achieved resolve
Co-authored-by: Bilal Elmoussaoui <[email protected]>
Looks good to me! Still not a fan of the gif, but I will update that later to have a consistent look across the examples. Thank you for your contribution |
Tried fix it #853