Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: hongxing on October 18, 2005, 10:02:01 am

Title: how to invoke code completion window?
Post by: hongxing on October 18, 2005, 10:02:01 am
int main()
{
    prin    // <----------I pressed Ctrl+J, not code completion window poped, why?
  

thanks!
Title: Re: how to invoke code completion window?
Post by: Urxae on October 18, 2005, 10:12:24 am
Did you put the right includes at the top?

Code
#include <stdio.h>

Oh, and don't forget to put the default compiler #include paths in your settings -> compiler options -> directories -> compiler (or something like that, don't have C::B handy at the moment)

EDIT: Oh, and indeed you need to press Ctrl+Space, not Ctrl+J. Thanks Squizzz, I missed that. :oops:
Title: Re: how to invoke code completion window?
Post by: squizzz on October 18, 2005, 11:30:13 am
int main()
{
    prin    // <----------I pressed Ctrl+J, not code completion window poped, why?
 
This happened, because Ctrl+J doesn't invoke Code Completion (Ctrl + Space does).
Ctrl+J stands for Auto-completion feature, which is somewhat different than Code Completion. Check Settings->Editor->Auto-complete for more details. (it's also where you can define your own keywords, like prin for example)
Title: Re: how to invoke code completion window?
Post by: hongxing on October 19, 2005, 02:29:08 am
you are right, press ctrl+space to invoke.

but is only shows the functions in my project, when I press "prin" and then ctrl+space, not prntf related function showed.

I have add /usr/include to then path->compiler, whay?

another question, when the code completion showed, how to close it only use keyboard? now I can only close it using mouse click.