Re: [pygtk] vtk problem with libpng

2003-10-15 Thread John Hunter
 John == John Hunter [EMAIL PROTECTED] writes:

John It's not clear to me importing vtk would change the libpng
John that gtk is linking with.

David Thompson, on the VTK mailing list, advised me to compile 
with VTK_USE_SYSTEM_PNG turned ON, as well as

VTK_USE_SYSTEM_EXPAT
VTK_USE_SYSTEM_JPEG
VTK_USE_SYSTEM_TIFF
VTK_USE_SYSTEM_ZLIB

which worked.  These options are exposed by cmake -i if you request to
see the advanced options.

JDH
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] vtk problem with libpng

2003-10-14 Thread John Hunter

[ I have been having trouble with my pygtk 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()


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] VTK

2003-03-24 Thread Johan Dahlin
We also have distutils support, maybe that will be easier for you, just
type:

python setup.py install

add --prefix=/usr/local if you want to specify a prefix.

sn 2003-03-23 klockan 22.25 skrev George A. Dowding:
 Good to know but it produced essentially the same errors.
 
 %./autogen.sh --prefix=/home/george/local
 ... 
 [Warnings from auto*]
 [while running the configure script]
 ./ltconfig: Can't open ./ltconfig: No such file or directory
 configure: error: libtool configure failed
 
 
 James Henstridge writes:
   George A. Dowding wrote:
   
   Any help would be appreciated.
   
   I am trying to comple pygtk from cvs with patches to use VTK.
   My current problem relate to the more general issue of compiling
   pygtk from source.  I tried following the directions from here
   http://www.airs.com/ian/configure/configure_2.html#SEC10
 
   
   Try running this:
 ./autogen.sh --prefix=/usr
   
   (or whatever prefix you want to install it into).
-- 
Johan Dahlin [EMAIL PROTECTED]
Async Open Source

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] VTK

2003-03-23 Thread George A. Dowding
Any help would be appreciated.

I am trying to comple pygtk from cvs with patches to use VTK.
My current problem relate to the more general issue of compiling
pygtk from source.  I tried following the directions from here
http://www.airs.com/ian/configure/configure_2.html#SEC10 

I am having problems generating and running the  ./configure script? 
I am running FreeBSD 4.7.  I have installed recent versions of
autoconf, automake, and libtool.  

autoconf 2.57
automake 1.7.3
libtool 1.43

aclocal:
%aclocal -I /usr/X11R6/share/aclocal/ -I /usr/local/share/aclocal/
%

autoconf:
%autoconf
configure.in:26: warning: do not use m4_patsubst: use patsubst or m4_bpatsubst
configure.in:177: warning: do not use m4_regexp: use regexp or m4_bregexp

autoheader:
%autoheader
WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
WARNING: and `config.h.top', to define templates for `config.h.in'
WARNING: is deprecated and discouraged.
 
WARNING: Using the third argument of `AC_DEFINE' and
WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without
WARNING: `acconfig.h':
 
WARNING:   AC_DEFINE([NEED_MAIN], 1,
WARNING: [Define if a function `main' is needed.])
 
WARNING: More sophisticated templates can also be produced, see the
WARNING: documentation.


automake:
configure.in:26: warning: do not use m4_patsubst: use patsubst or m4_bpatsubst
configure.in:177: warning: do not use m4_regexp: use regexp or m4_bregexp
configure.in:28: your implementation of AM_INIT_AUTOMAKE comes from an
configure.in:28: old Automake version.  You should recreate aclocal.m4
configure.in:28: with aclocal and run automake again.
/home/george/local/share/automake-1.7/am/depend2.am: am__fastdepCC does not appear in 
AM_CONDITIONAL
/home/george/local/share/automake-1.7/am/depend2.am: am__fastdepCC does not appear in 
AM_CONDITIONAL


When I run ./configure:
./ltconfig: Can't open ./ltconfig: No such file or directory
configure: error: libtool configure failed

John Hunter writes:
   George == George A Dowding [EMAIL PROTECTED] writes:
  
  George Hello, I am looking for information on using Pygtk and
  George VTK.  I haven't come across anything that explains how to
  George do that.  If anybody can point me in the right direction,
  George I would appreciated it.
  
[cut]
  
  I'm using CVS pygtk1.99.15, VTK4.2 and python 2.2 on redhat linux 8.
  
  If you need more info or help, let me know.
  
  John Hunter
  ___
  pygtk mailing list   [EMAIL PROTECTED]
  http://www.daa.com.au/mailman/listinfo/pygtk
  Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

-- 
How many times before 
could you tell I didn't care
when you turned your back on me 
I new we'd get nowhere

New Order, Substance Disk 2,  Lonesome Tonight 

[EMAIL PROTECTED] 
http://www.math.uaa.alaska.edu/~dowdingg


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] VTK

2003-03-23 Thread James Henstridge
George A. Dowding wrote:

Any help would be appreciated.

I am trying to comple pygtk from cvs with patches to use VTK.
My current problem relate to the more general issue of compiling
pygtk from source.  I tried following the directions from here
http://www.airs.com/ian/configure/configure_2.html#SEC10 
 

Try running this:
 ./autogen.sh --prefix=/usr
(or whatever prefix you want to install it into).

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] VTK

2003-03-23 Thread George A. Dowding
Good to know but it produced essentially the same errors.

%./autogen.sh --prefix=/home/george/local
... 
[Warnings from auto*]
[while running the configure script]
./ltconfig: Can't open ./ltconfig: No such file or directory
configure: error: libtool configure failed


James Henstridge writes:
  George A. Dowding wrote:
  
  Any help would be appreciated.
  
  I am trying to comple pygtk from cvs with patches to use VTK.
  My current problem relate to the more general issue of compiling
  pygtk from source.  I tried following the directions from here
  http://www.airs.com/ian/configure/configure_2.html#SEC10 

  
  Try running this:
./autogen.sh --prefix=/usr
  
  (or whatever prefix you want to install it into).

-- 
How many times before 
could you tell I didn't care
when you turned your back on me 
I new we'd get nowhere

New Order, Substance Disk 2,  Lonesome Tonight 

[EMAIL PROTECTED] 
http://www.math.uaa.alaska.edu/~dowdingg/


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] VTK

2003-03-21 Thread John Hunter
 George == George A Dowding [EMAIL PROTECTED] writes:

George Hello, I am looking for information on using Pygtk and
George VTK.  I haven't come across anything that explains how to
George do that.  If anybody can point me in the right direction,
George I would appreciated it.

If you look in Wrapping/Python/vtk/gtk/ you'll see a class
GtkVTKRenderWindow that contains a demo in the __main__ section at the
bottom.  Currently, this works only with a patched version of pygtk
provided by John K Luebs that exposes xid.  You'll have to rebuild
pygtk from cvs with this patch.

It appears that people are moving to gtkglext, however, so I recently
adapted the gtkgl render window that ships with vtk to work with
gtkglext.  The same patch caveat applies.

Also, it currently only works under X windows because I am having
trouble getting pygtkglext working under win32 and hence can't test
the use of hwnd in place of xid for the gtkglext code.  But I expect
to have this resolved soon.  If you need this platform, let me know
and I can provide you with an installer.

Here is some demo code and the gtkglext render window class

The xid, hwnd patch
--- pygtk-1.99.15/gtk/gdk.override.orig	2003-03-07 15:12:46.0 -0500
+++ pygtk-1.99.15/gtk/gdk.override	2003-03-07 15:33:16.0 -0500
@@ -15,6 +15,12 @@
 #  include Numeric/arrayobject.h
 #endif
 
+#if defined(GDK_WINDOWING_X11)
+#include gdk/gdkx.h
+#elif defined(GDK_WINDOWING_WIN32)
+#include gdk/gdkwin32.h
+#endif
+
 extern PyTypeObject PyGtkWidget_Type;
 
 %%
@@ -1844,6 +1850,30 @@
 return Py_None;
 }
 %%
+override-slot GdkWindow.tp_getattr
+PyObject *
+_wrap_gdk_window_tp_getattr(PyGObject *self, char *attr)
+{
+GdkWindow *window = GDK_WINDOW(self-obj);
+
+#if defined(GDK_WINDOWING_WIN32)
+if (!strcmp(attr, hwnd)) {
+	return PyLong_FromVoidPtr(GDK_WINDOW_HWND(window));
+}
+#elif defined(GDK_WINDOWING_X11)
+if (!strcmp(attr, xid)) {
+	return PyLong_FromUnsignedLong(GDK_WINDOW_XID(window));
+}
+#endif
+
+{
+	PyObject *name = PyString_FromString(attr);
+	PyObject *ret = PyObject_GenericGetAttr((PyObject *)self, name);
+	Py_DECREF(name);
+	return ret;
+}
+}
+%%
 override gdk_window_get_geometry noargs
 static PyObject *
 _wrap_gdk_window_get_geometry(PyGObject *self)

The gtkglext class:


GtkGLExtVTKRenderWindow.py
Description: Binary data

Some demo code:


cylinder_demo.py
Description: Binary data


I'm using CVS pygtk1.99.15, VTK4.2 and python 2.2 on redhat linux 8.

If you need more info or help, let me know.

John Hunter
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] VTK

2003-03-20 Thread George A. Dowding
Hello,

I am looking for information on using Pygtk and VTK.  I haven't come
across anything that explains how to do that.  If anybody can point me
in the right direction, I would appreciated it.

-- 
How many times before 
could you tell I didn't care
when you turned your back on me 
I new we'd get nowhere

New Order, Substance Disk 2,  Lonesome Tonight 

[EMAIL PROTECTED] 
http://www.math.uaa.alaska.edu/~dowdingg


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/