tags:

views:

26

answers:

1

I would like to learn how to make a text editor using GTK+. I think the best way to do this is to watch what is happening in the code when one runs Gedit. I have been told that one has to compile the sources of Gedit and GTK+ for -g option. But as I am a very beginner of open source world, I would like to know

  1. How can I load the sources of GTK+ and Gedit to my computer?
  2. How to compile them to one package which can run on debugger?
  3. How to run the Gedit and debugger so that I can see what is going on when one runs the program?

I'm using Ubuntu 10.04. I haven't done debugging earlier so I thought that DDD or Nemiver would be the easiest to learn but any suggestions are welcome.

A: 

For Ubuntu, simply do:

cd ~/Desktop  # or wherever you want it
apt-get source gedit  # does not need sudo

Check the README / INSTALL files - they should give you plenty information about compiling, just adapt the instructions to your needs. For a simple compile it's just:

  ./configure
  make

The GEdit main development page is at: http://git.gnome.org/browse/gedit/
You can get the upstream source code using git clone git://git.gnome.org/gedit

Josh
OK. I compiled the program as sudo ./configure CFLAGS=-gsudo makecd gedit/But now ddd ./gedit shows the code but how can I run it line by line.
beginnerdebugger