-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Request to generate initial code on project creation #898
Comments
Thank you for the suggestion! One of the nice things about Processing is that even a single line of code is a valid program. There’s no need for setup or draw unless you want to change the sketch size or animate something. For this reason, we don’t plan to make this change. |
Agreed but maybe we could allow users to define their starting sketch for themselves, like blender does with File->Defaults->Save Startup File |
I think there's a good idea here. What if the "Sketch" menu had an "insert template" submenu option, with a few choices like "basic animated sketch", that would insert something like this: void setup() {
size(500, 500);
// write code that will be called once in this function
}
void draw() {
// write code that will be called for every frame here
} and maybe an "interactive sketch" option that had the above template plus more empty functions for the mouse and key events. And the comments in the template could match the user's language preferences. This would be helpful for beginners because it would provide some guidance on code structure and also save them the time of looking up the names of the mouse and key event functions when they forget. And it would help me because I keep starting my Processing Sketches with "def setup()" by mistake... |
Good points both of you. I read a bit too quickly and didn't notice @nagesh007's suggestion to make it an optional setting. My apologies! |
@SableRaf Can you please assign this issue to me |
Hi @SushantBansal-tech, I just assigned you. Thanks for picking this up! Let us know if you need any guidance. How are you thinking of approaching this issue? |
@SableRaf . Please provide some guidance I have discussed some thing about how I am approaching this issue |
@SableRaf I want to modify the Processing source code to automatically insert some default code whenever a new tab is created. However, I am having trouble understanding the interaction between Sketch.java, SketchCode.java, Editor.java, and PApplet.java. Could you guide me on: The execution order when a new tab is created. Where I should modify the code to insert default content into a new tab. How these classes interact when handling multiple tabs. |
@SushantBansal-tech I'm leaning more towards the suggestion by @hx2A to have a new menu item for inserting a template.
cc @Stefterv |
@SableRaf okay I understand what we have to do |
My personal preference would still be to define a file for a new sketch (shocker!), in any case please also think about how users of the PDE will be able to define their own templates to be inserted. For the first iteration I think it is fine if those templates just get pasted into the editor tab you are looking at, later we can look at making that interaction a bit more refined if it needs it UX wise |
Relevant sub-area for this feature?
PDE
Feature description
Whenever we click on "File > New", New sketch appears but it will be empty. We need to start writing setup and draw functions manually. I kindly request you to generate initial code on new sketch creation. (Maybe this feature can switched on/off in preferences)
Benefits
Possible challenges
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: