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

library: Add rust demo calendar #581

Merged
merged 6 commits into from
Sep 8, 2023

Conversation

M-Sabrina
Copy link
Contributor

No description provided.

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

Apart from the one comment, it looks good to me! :)

pub fn main() {
let calendar: gtk::Calendar = workbench::builder().object("calendar").unwrap();

calendar.connect_day_notify(clone!(@weak calendar => move |_| {
Copy link
Contributor

@Hofer-Julian Hofer-Julian Sep 8, 2023

Choose a reason for hiding this comment

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

The closure gives you calendar so you don't need the clone! here

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

Some last things I've noticed.

The move is only necessary if you move something "into" the closure. You don't do this here.

src/Library/demos/Calendar/code.rs Outdated Show resolved Hide resolved
src/Library/demos/Calendar/code.rs Outdated Show resolved Hide resolved
src/Library/demos/Calendar/code.rs Outdated Show resolved Hide resolved
src/Library/demos/Calendar/code.rs Outdated Show resolved Hide resolved
@Hofer-Julian Hofer-Julian merged commit 2a559b5 into workbenchdev:main Sep 8, 2023
1 check passed
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.

2 participants