Hi!
I'm trying to create a windows installer for a small app that uses
python + pygtk + gtk with the 'py2exe + innosetup' method. For that I
first have to get the app working with hand-installed python + pygtk +
gtk, of course (so that I can run py2exe and copy the necessary dll-s).
I installed python-2.4.3.msi from python.org,
pygtk-2.8.6-1.win32-py2.4.exe from
http://www.pcpm.ucl.ac.be/~gustin/win32_ports/ and
gtk-win32-2.8.14-rc1 from http://gladewin32.sourceforge.net/
(I'm using windows 2000 as an OS)
Small 'Helloworld' apps work, but I get a segfault when calling
gtk.glade.set_custom_handler(). Attached is a small example which
segfaults.
I also tried to use the gtk installer from
http://gimp-win.sourceforge.net/stable.html (version
gtk+-2.8.9-setup-1.zip) instead of the ones from gladewin32, but in
that case even 'helloworld' apps crash with a 'libglib.dll not
found' error message. (where is the version, etc.) such a dll
file is installed by the gimp-win installer to a directory that is on
the PATH, so I think that the pygtk bindings should be able to find
it. Any ideas what else should be set?
I guess the segfaults when calling gtk.glade.set_custom_handler() are
due to some internal mismatch (perhaps because python and gtk where
compiled with different compilers?). But the above should work (as
that is the "recommended way" as far as I could see). And I bet that
_some_ people have installed python + pygtk + gtk with basically the
same method. Which exact installers and versions have you used?
(I would like to avoid having to compile anything, if at all
possible. Using older versions would be acceptable, however.)
Thanks in advance,
Abel Daniel
--
#!/usr/bin/env python
# originally from a tutorial which was:
#Licence: GPLv2.0
#Copyright: Dave Aitel
import sys
import pygtk
#tell pyGTK, if possible, that we want GTKv2
pygtk.require("2.0")
import gtk
import gtk.glade
import gobject
def insert_row(model,parent,firstcolumn,secondcolumn):
myiter=model.insert_after(parent,None)
model.set_value(myiter,0,firstcolumn)
model.set_value(myiter,1,secondcolumn)
return myiter
class appgui:
def __init__(self):
"""
In this init we are going to display the main serverinfo window
"""
gladefile="demogtk.glade"
windowname="serverinfo"
print "this is where the segfault happens:"
gtk.glade.set_custom_handler(self.custom_maker)
print "we wont reach this"
self.wTree=gtk.glade.XML (gladefile,windowname)
dic = { "on_button1_clicked" : self.button1_clicked,
"on_serverinfo_destroy" : (gtk.main_quit)}
self.wTree.signal_autoconnect (dic)
#CALLLBACKS
def button1_clicked(self,widget):
print "button clicked"
def custom_maker(self, *args, **kw_args):
print args, kw_args
l = gtk.Label('Foo')
l.show()
return l
app=appgui()
gtk.main()
--
where demogtk.glade is:
--
http://glade.gnome.org/glade-2.0.dtd";>
True
Server Info
GTK_WINDOW_TOPLEVEL
GTK_WIN_POS_NONE
False
True
False
True
False
0
True
True
GO!
True
GTK_RELIEF_NORMAL
0
False
False
True
make_custom
0
0
Mon, 01 May 2006 10:08:53
GMT
0
False
False
--
___
pygtk mailing list pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/