1

I have just started GTK+ coding in C. I was curious whether i can get syntax highlight and auto-completion working for my GTK code... because as a beginner it would be helpful.

I was completely convinced that it was not possible until i came across this video on youtube:

https://www.youtube.com/watch?v=AyeQrO1VDFM&feature=plcp I asked the uploader for help, but turns out his last activity on youtube was in Septembeer :(

I also tried opening the gtk.h file with geany as i had read somewhere that it worked, but unfortunately it didn't work too.

Any help? :'(

3

2 Answers 2

1

First create a file called gtk_headers.c. Add this line and save it #include <gtk/gtk.h>

Now run one of the following based on which version of GTK+ you are using.

GTK+2:

gcc -E gtk_headers.c `pkg-config gtk+-2.0 --cflags --libs` -o
gtk_headers.h

GTK+3:

gcc -E gtk_headers.c `pkg-config gtk+-3.0 --cflags --libs` -o
gtk_headers.h


Finally, open the output file (gtk_headers.h) in Geany while your project is open. After a few seconds syntax highlighting and autocompletion will begin to work.

1
  • Thanks @Louis! That Worked.... I also found an alternative method which is generating gtk3.c.tags file through geany...and then load it..so that it learns the synatxes.. Thanks a lot! Btw, your method can be easily incorporated in a script..so im going with it.. Nov 2, 2012 at 8:08
3

Download this package and extract it to ~/.config/geany/tags.

Restart Geany and you're done!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .