Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: GabrielNoob on November 16, 2016, 12:23:43 am

Title: How to change the default code?
Post by: GabrielNoob on November 16, 2016, 12:23:43 am
(https://s16.postimg.org/dbs7q7x4h/Sem_t_tulo.png) (https://postimg.org/image/dbs7q7x4h/)
https://s16.postimg.org/iafq4r0xh/Sem_t_tulo.png
I would like to customize the initial code in CodeBlock
thanks
Title: Re: How to change the default code?
Post by: oBFusCATed on November 16, 2016, 09:09:42 am
This is part of the wizard and its files. You can modify them. Or even create a template project.
Title: Re: How to change the default code?
Post by: rlb on November 21, 2016, 11:10:28 am
To be precise, if you right-click on the project wizard itself, you can modify what the wizard does; but if you want to modify the file itself, AFAICT that can't be done through the IDE, you'll have to edit the template file by hand. Luckily that's not difficult, though you may have to edit the file in administrator mode if you're on Windows. I don't know whether they're write-protected on Linux or other systems as well, but you'll know how to override that if necessary.
The file in question (if you've chosen the same wizard I did; if not, it's easily findable from there) is <codeblocks home>/share/CodeBlocks/templates/wizard/console/cpp/main.cpp.
If there's a way to edit it from the IDE, I'd like to know; but if not, you can at least do it by hand.
Title: Re: How to change the default code?
Post by: GabrielNoob on November 25, 2016, 08:03:00 pm
thanks rlb, worked correctly :D