def set_active_text(self, comboboxtext_widget, text_list, text):
"""
Set active text of ``comboboxtext_widget`` to ``text`` if ``text`` is
in ``text_list``.
:param comboboxtext_widget: :class:`Gtk.ComboBoxText`
:param text_list: list of string appened to ``comboboxtext_widget``
:param text: string to set active as :class:`str`
"""
for index, text_element in enumerate(text_list):
if text == text_element:
comboboxtext_widget.set_active(index)
break
评论列表
文章目录