-
Notifications
You must be signed in to change notification settings - Fork 18
Native method guide rework #297
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
base: main
Are you sure you want to change the base?
Conversation
|
I've simplified the code a bit. And I had to add |
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.
I agree that we can move the "Calling back into Java from JavaScript" after the "Walkthrough". Same goes for the "Converting Parameters and Return Values" part. Please move both of these further down. Maybe we should add one main header for the example, so it looks like this:
├── Steps to implement native methods in CheerpJ
├── Declaring Native Methods in Java
├── Implementing Native Methods in JavaScript
├── Initializing CheerpJ with the natives option
└── Example Walkthrough
├── Calling back into Java from JavaScript
└── Converting Parameters and Return Values
We do the same in the native libraries guide.
| public class Example { | ||
| public static void main(String[] args) { | ||
| nativeAlert("Hello, world!"); | ||
| Alert("Hello, world!"); |
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.
We added the "native" prefix to all the previous native functions. Also leave it here for consistency.
|
I tried to reorder the page itself in the documentation site where currenty the native methods guide comes after the native libraries but couldn't figure out how to do it. This following order would make more sense. |
No description provided.