[vtkusers] lib png prob with pygtk2 and vtk 4.3
John Hunter
jdhunter at ace.bsd.uchicago.edu
Tue Oct 14 16:46:01 EDT 2003
[ I have been having trouble with my vtk mailing list subscription and
am resending this since it bounced the first time. Apologies for any
duplicates]
I am developing an application which uses vtk with pygtk-2.0.0. When
I import vtk (whether or not I use it), my stock gtk icons no longer
work under redhat 9, and I get errors like the following
(toolbar_test.py:23182): Gtk-WARNING **: Error loading icon: Failed to load image '/usr/share/icons/Bluecurve/24x24/stock/gtk-new.png': Fatal error in PNG image file: Incompatible libpng version in
application and library
With the same version of VTK and pygtk, I had no problems under redhat
linux 8 (I just upgraded the OS) so it looks like a incompatibility
between a new libpng and a png lib that ships with VTK. I am not sure
how to proceed in fixing it, so I'm looking for suggestions.
Below is a test script which replicates the problem. When you comment
out the import vtk line, the error messages go away and the icons
display fine.
It's not clear to me importing vtk would change the libpng that gtk is
linking with.
Any suggestions welcome,
John Hunter
Version info
python 2.3
VTK-4.3-2003-08-13 snapshot
pygtk-2.0.0
redhat linux 9
Test script:
import pygtk
pygtk.require('2.0')
import gtk
import vtk
toolbar = gtk.Toolbar()
iconSize = gtk.ICON_SIZE_SMALL_TOOLBAR
def dummy(button): pass
iconw = gtk.Image()
iconw.set_from_stock(gtk.STOCK_NEW, iconSize)
buttonNew = toolbar.append_item(
'New',
'Load new 3d image',
'Private',
iconw,
dummy)
iconw = gtk.Image()
iconw.set_from_stock(gtk.STOCK_QUIT, iconSize)
buttonQuit = toolbar.append_item(
'Quit',
'Quit program',
'Private',
iconw,
lambda button: gtk.mainquit())
toolbar.show()
win = gtk.Window()
win.show()
win.add(toolbar)
gtk.mainloop()
More information about the vtkusers
mailing list