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

Come up with a good design for Event handling #4

Open
renatoathaydes opened this issue Dec 10, 2013 · 5 comments
Open

Come up with a good design for Event handling #4

renatoathaydes opened this issue Dec 10, 2013 · 5 comments

Comments

@renatoathaydes
Copy link
Owner

EvenHandling can probably benefit from Ceylon's syntax, similarly to Bindings as on #2.

@lucaswerkmeister
Copy link

Eliminate ActionListener interfaces and just use Callables directly? Like this:

interface ActionListener => Anything(ActionEvent);

closeButton.setOnAction(void (ActionEvent event) {
    print("Bye!");
    process.exit(0);
});

@gavinking
Copy link
Collaborator

Eliminate ActionListener interfaces and just use Callables directly?

+1.

@renatoathaydes
Copy link
Owner Author

Yes, I agree... creating event handlers inside node declarations should also be straight-forward...

Button {
    onAction = (ActionEvent event) => print(event);
}

@lucaswerkmeister
Copy link

creating event handlers inside node declarations should also be straight-forward...

yes, that also looks very nice. what should be the default value in the constructor – noop() or null?

@renatoathaydes
Copy link
Owner Author

I've been making this kind of thing null... it's not shared and the only time I need to check it for existence is when creating the component, simple enough.

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

No branches or pull requests

3 participants