Page 1 of 1
Code completion with Fox Toolkit
Posted: Sat Dec 12, 2009 1:30 am
by doctor_vitus
Hi,
has anybody managed to get code completion of CodeLite to work for the Fox Toolkit library (current stable version 1.6.37,
http://fox-toolkit.org/)?
Operating system is a current Arch Linux x86_64, Fox Toolkit from the repositories, self-compiled CodeLite v2.0.0.3431.
I created a new
Simple Executable (g++) project, set
-g;$(shell fox-config --cflags) as the compiler options and
-g;$(shell fox-config --libs) as the linker options.
The Hello World example from
http://en.wikipedia.org/wiki/Fox_toolkit compiles just fine, but there is no code completion.
Any hints?
Thanks in advance and best regards,
doctor_vitus
Re: Code completion with Fox Toolkit
Posted: Sat Dec 12, 2009 10:26 am
by eranif
You need to add the paths of FOX to the code-completion parser.
Read this:
http://codelite.org/LiteEditor/CodeCompletion
and this:
http://codelite.org/LiteEditor/SettingUpCodeCompletion
If you still got some problems - post again
Eran
Re: Code completion with Fox Toolkit
Posted: Sat Dec 12, 2009 7:51 pm
by doctor_vitus
Hi Eran,
thanks for your reply. I added /usr/include/fox-1.6 to the workspace's parser include paths and retagged the workspace. Unfortunately it did not make any difference. Also restarting CodeLite and rebuilding the project didn't help.
I tried to include one class header file explicitely (instead of including only fx.h) using
assigning the Button from the sample code to a variable
Code: Select all
FXButton *b=new FXButton(main, "&Hello, World!", NULL, &application, FXApp::ID_QUIT);
It all compiles fine, but if i try to run code completion for b, nothing happens.
Best regards,
doctor_vitus
Re: Code completion with Fox Toolkit
Posted: Sat Dec 12, 2009 10:20 pm
by eranif
Ok, I downloaded the FOX toolkit, I set up the following and it is working:
- I added the following path the parser include files:
Code: Select all
C:\Development\C++\fox-1.6.37\include
Notice the 'include' since this is where FXButton.h really exist.
- Open the tags settings dialog (from the menu: 'Settings -> Tags Settings') and select the 'Advanced tab.
Open the pre-processor list, and add this at the bottom:
- Retag your workspace (from the menu: "Workspace -> Retag Workspace (FULL)")
Should be working now (see attachment)
fox-cc.png
Eran
Re: Code completion with Fox Toolkit
Posted: Sat Dec 12, 2009 10:55 pm
by doctor_vitus
Now it's working for me, too.
The first problem was that I did not specify the FX namespace. GCC does not seem to care about this, but code completion does not work unless you either use the FX:: prefix on the variable declaration or add
The second problem was that the Hello World example from Wikipedia which I used for testing uses
main as the variable name for the main window object. Even with the above, code completion did not work for this, as (I suppose)
main is treated as a reserved keyword. As soon as I changed the name to
w, this worked for me, too.
Thanks a lot for your efforts and your great support, Eran. Have a nice weekend.