Skip to content
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

Merged
merged 3 commits into from
Jan 12, 2021
Merged

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Jan 11, 2021

Just like what we talked about in #149, here is the non-future (and non-blocking) version.

cc @sophie-h @sdroege @bilelmoussaoui

gtk4/src/dialog.rs Outdated Show resolved Hide resolved
gtk4/src/dialog.rs Outdated Show resolved Hide resolved
gtk4/src/dialog.rs Outdated Show resolved Hide resolved
@GuillaumeGomez GuillaumeGomez force-pushed the dialog-run branch 8 times, most recently from 6f9abf8 to 15451c9 Compare January 11, 2021 15:04
@sdroege
Copy link
Member

sdroege commented Jan 11, 2021

This branch has conflicts that must be resolved

@GuillaumeGomez
Copy link
Member Author

CI passed! \o/

/// println!("Answer: {:?}", answer);
/// });
/// ```
fn run<F: FnOnce(&Self, ResponseType) + 'static>(&self, f: F);
Copy link
Member

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().

Copy link
Member

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"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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.

Copy link
Member

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.

@GuillaumeGomez GuillaumeGomez changed the title Add Dialog::run Add Dialog::run_async Jan 11, 2021
@sdroege
Copy link
Member

sdroege commented Jan 12, 2021

@bilelmoussaoui This is ok then?

@bilelmoussaoui
Copy link
Member

Looks good to me, thanks!

@bilelmoussaoui bilelmoussaoui merged commit 96bc469 into gtk-rs:master Jan 12, 2021
@GuillaumeGomez GuillaumeGomez deleted the dialog-run branch January 12, 2021 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants