-
-
Notifications
You must be signed in to change notification settings - Fork 172
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 Dialog::run_async #159
Conversation
60c5198
to
1e91667
Compare
6f9abf8
to
15451c9
Compare
|
15451c9
to
c355d7f
Compare
d8e4399
to
982b5fc
Compare
CI passed! \o/ |
gtk4/src/dialog.rs
Outdated
/// println!("Answer: {:?}", answer); | ||
/// }); | ||
/// ``` | ||
fn run<F: FnOnce(&Self, ResponseType) + 'static>(&self, f: F); |
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.
Should probably be called run_async()
because it's not like the original run()
.
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.
ebassi suggested response as a name, which sounds better to me instead of calling it "run"
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.
"response" won't work https://gtk-rs.org/gtk4-rs/gtk4/trait.DialogExt.html#tymethod.response
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.
Ah :/ I wonder why some signals are named "$signal_name" like the response here while others are named "emit_$signal_name" like the emit_close
.
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.
emit_XXX()
are the ones we autogenerated if a signal is marked as action signal. response()
has a emission function in C that is named like that.
dc244a7
to
c6933c4
Compare
@bilelmoussaoui This is ok then? |
Looks good to me, thanks! |
Just like what we talked about in #149, here is the non-future (and non-blocking) version.
cc @sophie-h @sdroege @bilelmoussaoui