After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 607492 - widget.get_name() error?
widget.get_name() error?
Status: RESOLVED WONTFIX
Product: pygtk
Classification: Bindings
Component: gtk
2.17.x
Other Linux
: Normal critical
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-19 21:15 UTC by Francesco Meloni
Modified: 2010-08-13 13:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Francesco Meloni 2010-01-19 21:15:39 UTC
This code extracted works until upgrade lucid 
with
python-gtk2 2.17.0 :

gl = gtk.Builder()
gl.add_from_file(glade_file)
widgets = gl.get_objects()
for widget in self.widgets:
    widget_name = widget.get_name()


widget_name  was the name used on glade file for the object like "workin_year" 
now it return the gobject type like GtkLabel 

Is it a regression Bug, is it a feature?
Comment 1 Gian Mario Tagliaretti 2010-01-20 19:41:23 UTC
Since we didn't change anything between 2.16.x and 2.17.x I'm cc'ing Johan, he can give a competent answer since he wrote GtkBuilder :)
Comment 2 towb 2010-03-24 02:02:51 UTC
Classes can inherit get_name from Widget or implement Buildable. Some, like Adjustment, do neither, so this may fail.

Of course this begs the question why Builder can still create them.

There probably should be a get_object_names.
Comment 3 Francesco Meloni 2010-04-21 12:23:41 UTC
Hi, searching for a temporary solution i found this comment in launchpad

https://bugs.launchpad.net/ubuntu/+source/pygtk/+bug/507739/comments/8

i don't know if it is a good "solution" but for now works for me 

ciao
F.
Comment 4 Benny Malengier 2010-05-05 08:49:14 UTC
Just to note, this bug causes the Gramps application to crash on ubuntu 10.04:
http://www.gramps-project.org/bugs/view.php?id=3906 

What is the best way to move forward? Change applications that use it, or update gtk/pygtk to obtain the old behaviour again?
Comment 5 Benny Malengier 2010-05-05 09:06:49 UTC
It would seem the solution of 
https://bugzilla.gnome.org/show_bug.cgi?id=591085

causes this. 
So, I suppose the old behavior will not return and applications must be changed?
Comment 6 John Stowers 2010-08-13 13:13:29 UTC
Old behavior won't return as per bug 591085