Skip to content

Commit

Permalink
Use gtk.Builder.get_name for widget IDs
Browse files Browse the repository at this point in the history
This makes gPodder work again for newer versions
of GTK+ that have the bug with the widget name and
the GtkBuilder ID fixed. Thanks to Sampo Savola
and Klaus Doblmann for reporting the bug and
testing the fix on different platforms.
  • Loading branch information
thp committed Jan 21, 2010
1 parent b20357f commit c8a5270
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/gpodder/gtkui/base.py
Expand Up @@ -107,7 +107,10 @@ def create_fingerscroll():
scroll.set_property('deceleration', .975)
else:
scroll = hildon.PannableArea()
scroll.set_name(widget.get_name())

# The following call looks ugly, but see Gnome bug 591085
scroll.set_name(gtk.Buildable.get_name(widget))

return scroll

def container_get_child_pos(container, widget):
Expand Down Expand Up @@ -173,7 +176,9 @@ def set_attributes(self):
if isinstance(widget, gtk.ScrolledWindow):
widget = self._handle_scrolledwindow(widget)

widget_name = widget.get_name()
# The following call looks ugly, but see Gnome bug 591085
widget_name = gtk.Buildable.get_name(widget)

widget_api_name = '_'.join(re.findall(tokenize.Name, widget_name))
widget.set_name(widget_api_name)
if hasattr(self, widget_api_name):
Expand Down

0 comments on commit c8a5270

Please sign in to comment.