Hello,
I've several questions/bug reports concerning gnome-python...
I've a threaded version of python, and I've tried to use mainiteration().
It works well, excepted when the function is called from a callback. In that
case, it hangs. (see the attached example) I have to surround my call to
this function with a pair of thread_leaves()/threads_enter() to make it
work. Is this normal ? I thought these functions were intended to allow
calls of GTK that are not part of gnome-python...
Concerning GtkTree, I've also noticed some problems in version 1.0.4. There
is a typo at line 786 of gtk.py :
if attrs.has_key(attrs):
return attrs[attr](self._o)
...should rather be
if attrs.has_key(attr):
return attrs[attr](self._o)
More problematic is the fact that gtktreeitem.subtree causes a core dump
after the following message :
Gtk-CRITICAL **: file gtkobject.c: line 1161 (gtk_object_ref): assertion
`object != NULL' failed.
... in case there is no subtree for a given item, instead of returning None.
For the rest, it's a real pleasure to use this bindings of GTK and Gnome !
Fr�d�ric
--
Fr�d�ric GOBRY IDIAP
Rue du Simplon 4,
Research Assistant CH 1920 - Martigny
Machine Learning Group Tel: +41 27 721 77 31
from gnome.ui import *
from gtk import *
class Test (GtkDialog):
def __init__ (self):
GtkDialog.__init__ (self)
self.set_usize (200,200)
self.connect("delete_event", self.close)
return
def close (self, * arg):
print "before"
finished = 0
while not finished:
print "in the loop"
# uncomment the next line to make it work
# threads_leave ()
if mainiteration (FALSE) == 0: finished = 1
# uncomment the next line to make it work
# threads_enter ()
print "after"
mainquit ()
return
f = Test ()
f.show_all ()
mainloop ()