def __init__(self): last_source = Gst.get_string('map-source-id') Gst.bind_with_convert('map-source-id', MapView, 'map-source', MAP_SOURCES.get, lambda x: x.get_id()) for source_id in sorted(MAP_SOURCES): menu_item = RadioMenuItem(MAP_SOURCES[source_id]) if last_source == source_id: menu_item.set_active(True) Widgets.map_source_menu.show_all()