6

My situation is Aptana eclipse plug-in installed and working properly.

If I from gi.repository import Gtk the code completion I'm used to from import gtk is gone. Any solutions or is it just a bug?

My interim solution is keeping an import gtk\ngtk. in a clipboard manager and dropping it in when I need hints.

RobotHumans
  • 807
  • 10
  • 25

2 Answers2

6

Yes, there is! You should add gi to the forced builtins and you'll get a code completion:

Go to the Window->Preferences, PyDev->Interpreter python section and add gi to the "Forced builtin" tab for each interpreter you would like to use Gtk3.

More about this: http://pydev.org/manual_101_interpreter.html

hzsolt94
  • 76
  • 1
  • 4
  • You Sir, are awesome :) I had just tried gi.repository with no success... I was so close and so far to solution :) You saved my day – Alar Mar 07 '14 at 07:35
0

from gi.repository import Gtk

is not same like

import gtk

With the statement "

from gi.repository import Gtk

your are importing Gtk 3. With

import gtk

your are importing Gtk 2.

I would say that you code completion doesn't know Gtk 3.

maybe useful:

Tutorial for Gtk 3 http://readthedocs.org/docs/python-gtk-3-tutorial/en/latest/index.html

http://live.gnome.org/PyGObject

hendrikschneider
  • 1,696
  • 1
  • 14
  • 26
  • I'm aware of the difference from gtk2 to gtk3. I was wondering if the code completion in Aptana for that module had a solution or not. – RobotHumans Apr 11 '12 at 13:43