Description of problem:
Having just yum upgraded to latest rawhide of 2005-01-03, upgrading
pygtk2 from 2.4.1-1 to 2.4.1-2, I now get this warning message
when I load my .glade file:
/usr/sbin/system-config-bind:70: GtkWarning: Mixing deprecated and
non-deprecated GtkToolbar API is not allowed
self.xml = gtk.glade.XML ( SCB+/+system-config-bind.glade )
This message was not generated in pygtk2-2.4.1-1 .
This message now appears every time the application is run, and
it is not clear how it can be avoided, aside from rewriting the app
not to use glade at all (which I now wish I'd done from the start!).
I strongly object to this message for these reasons:
1. If something a programmer writes is "not allowed" in an API,
the API should not allow it, not complain about it.
2. The information content of the message is insufficient -
exactly what "deprecated"/"non-deprecated" parts of the API are
being mixed ? How I am meant to know how what precisely is
causing the problem from this message ?
Is there any way I can turn generation of this message off ?
If so, please tell me how.
If not, please ammend the message to contain details about how
the problem can be fixed - ie. exactly what API components used
by my app should not be used together and which trigger the message
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Run a pygtk2-libglade app (eg. system-config-bind-4.0.0)
Annoying message is generated
No message should be generated, or the message should contain
sufficient information to allow me to rectify the problem
Whoops! I found out it is actually generated by gtk2-2.6.0-1, which got
yum upgraded from 2.4.13-11, in which the message was not generated.
The same comments above still apply - either:
1. The message should not be generated
or 2. There needs to be a way to disable its generation
or 3. It should contain sufficient information to allow a programmer
to prevent it being generated.
The offending file is:
./gtk+-2.6.0/gtk/gtktoolbar.c: 79: "Mixing deprecated and
non-deprecated GtkToolbar API is not allowed"
Moving to gtk+ package.
Part of this IS a pygtk problem: there should be a way of catching
and handling the gtk.GtkWarning exception, which there does not seem
self.xml = gtk.glade.XML ( SCB+'/'+'system-config-bind.glade'
except gtk.GtkWarning, w:
This did not work - the warning is still generated unconditionally.
I'm having to resort to:
sys.stdout = file("/dev/null","w")
sys.stderr = sys.stdout
self.xml = gtk.glade.XML(SCB+'/'+'system-config-bind.glade')
sys.stdout = sys.__stdout__
sys.stderr = sys.__stderr__
We can not include all of the toolbar api docs in that warning message...