def on_grid_songs_focus_in_event(self, widget, event):
""" We don't want 2 treeview with a selection,
so we walk trougth the siblings and their children
then call unselect_all() if it's a treeview
"""
stack = [self.get_view().get_parent()]
while any(stack):
element = stack.pop()
if isinstance(element, Gtk.TreeView) and element is not widget:
element.get_selection().unselect_all()
elif isinstance(element, Gtk.Container):
stack.extend(element.get_children())
评论列表
文章目录