Making pygtksourceview work in windows
So, I'm trying to get gtksourceview python bindings work under windows (I'm developing a cross platform gtk application that shows code, so gtksourceview seemed like a natural choice).
I have pygtk installed and working (I followed the instructions in http://www.pygtk.org/downloads.html)
I tried the instructions in http://projects.gnome.org/gtksourceview/ for gtksourceview.
Here is what I did:
Downloaded and extracted the latest gtksourceview window binaries from: http://ftp.gnome.org/pub/gnome/binaries/win32/gtksourceview/2.10/gtksourceview-2.10.0.zip
The website said gtksourceview needs libxml, so I downloaded and extracted the latest libxml window binaries from: http://xmlsoft.org/sources/win开发者_StackOverflow社区32/libxml2-2.7.6.win32.zip
Added the folders containing dll files to the PATH (in my computer they were c:\opt\gtksourceview\bin; C:\opt\libxml2-2.7.6.win32\bin)
Installed pygtksourceview with the windows installer: http://ftp.gnome.org/pub/gnome/binaries/win32/pygtksourceview/2.10/pygtksourceview-2.10.0.win32-py2.6.exe
Renamed the file libxml2.dll to libxml2-2.dll (after running depends on the gtksourceview dll)
Now, the gtksouceview widget seems to work, until I'm trying to set the code's language. When I do that python crashes.
Here is how I crash it in the console (the simplest way i could come up with):
>>>import gtksourceview2
>>>lang = gtksourceview2.language_manager_get_default().get_language('cpp')
>>>lang.get_style_ids()
I'm hoping I'm not the first person to use gtksourceview in python on windows. Any ideas what I should try?
So in case anyone else is wondering -- I grabbed the wrong libxml dll. The right one is in: http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libxml2_2.7.7-1_win32.zip
精彩评论