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

Rework (and rename) ext event #1401

Merged
merged 13 commits into from
Nov 17, 2020
Merged

Conversation

JAicewizard
Copy link
Contributor

@JAicewizard JAicewizard commented Nov 14, 2020

This mostly just adds comments.
I also got a more satisfying colour generation comming in another PR for this and the identity example.
I also think that this and the identity one are too similair to not be based on each other. Both use comands and have colours shifting going on. Both should handle the colour shifting the same way (not using timers like the identity example) so I will be opening a PR about completely redoing that one. It will also make it cleaner I think.

EDIT: I also will be opening a PR to remove the blocking_functions example since it really just has a lot of clutter and revolves around the same concept as this example.

sorry this took a while, my factorio addiction is acting up again.

@JAicewizard JAicewizard changed the title Rework ext event Rework (and rename) ext event Nov 14, 2020
@JAicewizard
Copy link
Contributor Author

I decided to rename form ext_event to async_event since "ext" (probably) stands for external, but the example doesnt really have anything external to it. Calling it async makes more sense as this example applies to all async events.
If you have any preference of keeping it let me know.

use druid::widget::prelude::*;
use druid::{AppLauncher, Color, Selector, Target, WidgetExt, WindowDesc};

// If you want to send commands to over event sinks you have to give it some kind
Copy link
Collaborator

Choose a reason for hiding this comment

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

commands to over event sinks not sure what you're saying here

Copy link
Contributor Author

@JAicewizard JAicewizard Nov 16, 2020

Choose a reason for hiding this comment

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

If you want to submit commands to an event sink is what I mean

Copy link
Collaborator

@futurepaul futurepaul left a comment

Choose a reason for hiding this comment

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

This is a great improvement! I'm fine with the name change. I could see people being confused that this isn't async in the general Rust ecosystem use of that word, but at the same time that's probably the word people are looking for for this kind of functionality?

@JAicewizard
Copy link
Contributor Author

yeah I thought about that too, I can rename it to threaded_event but I'm not sure people look for that. I will add a readme with some comments on the examples helping people find them. ext_event might be the druid name but that is very far away from how a beginning user sees it.

@futurepaul futurepaul self-assigned this Nov 16, 2020
Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

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

Looks good, a few little notes but I think this is an improvement!

druid/examples/async_event.rs Outdated Show resolved Hide resolved
.expect("launch failed");
}

fn generate_colours(event_sink: druid::ExtEventSink) {
Copy link
Member

Choose a reason for hiding this comment

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

Although I personally use international spellings frequently, we have decided to use Color instead of Colour in druid so I think it probably makes sense to be consistent with that here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh sry, I try to keep is US English as well, but my nature is very much still with colour.

Copy link
Member

Choose a reason for hiding this comment

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

me too, but sometimes we must defer to the imperialists. 😢

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

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

Thanks!

@cmyr cmyr merged commit 20a3b4d into linebender:master Nov 17, 2020
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.

3 participants