Hi,

First, a bit of context: completion in the Editor and the Python/IPython consoles are handled in very different ways. The reason is that we can't evaluate the code users are developing in the Editor to get completions (because it can be syntactically incorrect at any given moment). So we use two third-party libraries (rope and jedi) that try to get completions without evaluation.

That's why completion in our consoles will always be better than in the Editor. But that's a limitation of Python in general, and something not only suffered by Spyder but by any other Python IDE (e.g. PyDev, PyCharm, etc).

Second, some good news: since Spyder 2.3.3 you can get completions of PyGtk by installing the Jedi library, version 0.8.1. 2.3.3 is the first version that comes with integration with Jedi, older versions don't support it.

I tried your examples and they are working fine for me.


Cheers,
Carlos

El 02/03/15 a las 11:19, google.3.gnu...@wronghead.com escribió:
Hi all,

somehow I do not get the auto-completition of Spyder (2.3.1 out of current Debian Sid) working for GTK usage.
Following code was taken (and modified) from the PyGtk tutorial:

|
importpygtk
    pygtk.require('2.0')
importgtk
dialog =gtk.MessageDialog(type=gtk.MESSAGE_ERROR,buttons=gtk.BUTTONS_CLOSE)
    dialog.set_markup("Message")
    dialog.set_title(APP_NAME +" - Error")
    dialog.show()
    gtk.main()

|

And thisone fromanother tutorial,usinganother kind of import:

|

fromgi.repository importGtk

    message ="\n<b>Error.</b>\n"+message
    dialog =Gtk.MessageDialog(None,0,
Gtk.MessageType.ERROR,Gtk.ButtonsType.CLOSE,"unformated message")
    dialog.set_title(APP_NAME +" - Error")
    dialog.run()

|

In both cases I do not get the usual completition popups (except of the parts already used in code) – be it for classes of modules, their methods or constants – and I do not get any documentation for any methods like 'dialog.run()' or 'dialog.show()' at all.

I also tried to add some directorys to PYTHONPATH in Spyder:

|
/usr/lib/python2.7/dist-packages/gi/overrides/
/usr/lib/python2.7/dist-packages/gi/repository/
/usr/lib/python2.7/dist-packages/gi/_gobject/
/usr/lib/python2.7/dist-packages/gobject/
/usr/lib/python2.7/dist-packages/glib/
/usr/lib/python2.7/dist-packages/gtk-2.0/
/usr/lib/python2.7/dist-packages/gtk-2.0/gio/
/usr/lib/python2.7/dist-packages/gtk-2.0/gnome/
/usr/lib/python2.7/dist-packages/gtk-2.0/gnomevfs/
/usr/lib/python2.7/dist-packages/gtk-2.0/bonobo
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk

|

which also made no difference (even after restarting Spyder)
The code is in either case working as expected, so that should not be the problem.

If anyone has an idea how to fix this I'd be quite happy.

(As I am quite new to Python, Spyder and also GTK, these trys might also not be "the way" to import GTK libs, so if anybody could help out in any direction I'd be happy.)

Thanks, Jaleks
--
You received this message because you are subscribed to the Google Groups "spyder" group. To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+unsubscr...@googlegroups.com <mailto:spyderlib+unsubscr...@googlegroups.com>. To post to this group, send email to spyderlib@googlegroups.com <mailto:spyderlib@googlegroups.com>.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to spyderlib+unsubscr...@googlegroups.com.
To post to this group, send email to spyderlib@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to