本文整理汇总了Python中sugar3.graphics.combobox.ComboBox.append_separator方法的典型用法代码示例。如果您正苦于以下问题:Python ComboBox.append_separator方法的具体用法?Python ComboBox.append_separator怎么用?Python ComboBox.append_separator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sugar3.graphics.combobox.ComboBox
的用法示例。
在下文中一共展示了ComboBox.append_separator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_with_search_combo
# 需要导入模块: from sugar3.graphics.combobox import ComboBox [as 别名]
# 或者: from sugar3.graphics.combobox.ComboBox import append_separator [as 别名]
def _get_with_search_combo(self):
with_search = ComboBox()
with_search.append_item(_ACTION_EVERYBODY, _('Anyone'))
with_search.append_separator()
with_search.append_item(_ACTION_MY_FRIENDS, _('My friends'))
with_search.append_item(_ACTION_MY_CLASS, _('My class'))
with_search.append_separator()
# TODO: Ask the model for buddies.
with_search.append_item(3, 'Dan', 'theme:xo')
with_search.set_active(0)
with_search.connect('changed', self._combo_changed_cb)
return with_search
示例2: _get_when_search_combo
# 需要导入模块: from sugar3.graphics.combobox import ComboBox [as 别名]
# 或者: from sugar3.graphics.combobox.ComboBox import append_separator [as 别名]
def _get_when_search_combo(self):
when_search = ComboBox()
when_search.append_item(_ACTION_ANYTIME, _('Anytime'))
when_search.append_separator()
when_search.append_item(_ACTION_TODAY, _('Today'))
when_search.append_item(_ACTION_SINCE_YESTERDAY,
_('Since yesterday'))
# TRANS: Filter entries modified during the last 7 days.
when_search.append_item(_ACTION_PAST_WEEK, _('Past week'))
# TRANS: Filter entries modified during the last 30 days.
when_search.append_item(_ACTION_PAST_MONTH, _('Past month'))
# TRANS: Filter entries modified during the last 356 days.
when_search.append_item(_ACTION_PAST_YEAR, _('Past year'))
when_search.set_active(0)
when_search.connect('changed', self._combo_changed_cb)
return when_search
示例3: MainToolbox
# 需要导入模块: from sugar3.graphics.combobox import ComboBox [as 别名]
# 或者: from sugar3.graphics.combobox.ComboBox import append_separator [as 别名]
class MainToolbox(ToolbarBox):
__gsignals__ = {
'query-changed': (GObject.SignalFlags.RUN_FIRST, None,
([object])),
}
def __init__(self):
ToolbarBox.__init__(self)
self._mount_point = None
self._filter_type = None
self._what_filter = None
self.search_entry = iconentry.IconEntry()
self.search_entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
'entry-search')
text = _('Search in %s') % _('Journal')
self.search_entry.set_placeholder_text(text)
self.search_entry.connect('activate', self._search_entry_activated_cb)
self.search_entry.connect('changed', self._search_entry_changed_cb)
self.search_entry.add_clear_button()
self._autosearch_timer = None
self._add_widget(self.search_entry, expand=True)
self._favorite_button = ToggleToolButton('emblem-favorite')
self._favorite_button.set_tooltip(_('Favorite entries'))
self._favorite_button.connect('toggled',
self.__favorite_button_toggled_cb)
self.toolbar.insert(self._favorite_button, -1)
self._favorite_button.show()
self._what_search_combo = ComboBox()
self._what_combo_changed_sid = self._what_search_combo.connect(
'changed', self._combo_changed_cb)
tool_item = ToolComboBox(self._what_search_combo)
self.toolbar.insert(tool_item, -1)
tool_item.show()
self._when_search_combo = self._get_when_search_combo()
tool_item = ToolComboBox(self._when_search_combo)
self.toolbar.insert(tool_item, -1)
tool_item.show()
self._sorting_button = SortingButton()
self.toolbar.insert(self._sorting_button, -1)
self._sorting_button.connect('sort-property-changed',
self.__sort_changed_cb)
self._sorting_button.show()
# TODO: enable it when the DS supports saving the buddies.
# self._with_search_combo = self._get_with_search_combo()
# tool_item = ToolComboBox(self._with_search_combo)
# self.insert(tool_item, -1)
# tool_item.show()
self._query = self._build_query()
self.refresh_filters()
def _get_when_search_combo(self):
when_search = ComboBox()
when_search.append_item(_ACTION_ANYTIME, _('Anytime'))
when_search.append_separator()
when_search.append_item(_ACTION_TODAY, _('Today'))
when_search.append_item(_ACTION_SINCE_YESTERDAY,
_('Since yesterday'))
# TRANS: Filter entries modified during the last 7 days.
when_search.append_item(_ACTION_PAST_WEEK, _('Past week'))
# TRANS: Filter entries modified during the last 30 days.
when_search.append_item(_ACTION_PAST_MONTH, _('Past month'))
# TRANS: Filter entries modified during the last 356 days.
when_search.append_item(_ACTION_PAST_YEAR, _('Past year'))
when_search.set_active(0)
when_search.connect('changed', self._combo_changed_cb)
return when_search
def _get_with_search_combo(self):
with_search = ComboBox()
with_search.append_item(_ACTION_EVERYBODY, _('Anyone'))
with_search.append_separator()
with_search.append_item(_ACTION_MY_FRIENDS, _('My friends'))
with_search.append_item(_ACTION_MY_CLASS, _('My class'))
with_search.append_separator()
# TODO: Ask the model for buddies.
with_search.append_item(3, 'Dan', 'theme:xo')
with_search.set_active(0)
with_search.connect('changed', self._combo_changed_cb)
return with_search
def _add_widget(self, widget, expand=False):
tool_item = Gtk.ToolItem()
tool_item.set_expand(expand)
tool_item.add(widget)
widget.show()
self.toolbar.insert(tool_item, -1)
#.........这里部分代码省略.........