本文整理汇总了Python中sugar3.graphics.combobox.ComboBox.set_visible方法的典型用法代码示例。如果您正苦于以下问题:Python ComboBox.set_visible方法的具体用法?Python ComboBox.set_visible怎么用?Python ComboBox.set_visible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sugar3.graphics.combobox.ComboBox
的用法示例。
在下文中一共展示了ComboBox.set_visible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainToolbox
# 需要导入模块: from sugar3.graphics.combobox import ComboBox [as 别名]
# 或者: from sugar3.graphics.combobox.ComboBox import set_visible [as 别名]
#.........这里部分代码省略.........
if order == Gtk.SortType.ASCENDING:
sign = '+'
else:
sign = '-'
query['order_by'] = [sign + property_]
return query
def _get_date_range(self):
today_start = datetime.today().replace(hour=0, minute=0, second=0)
right_now = datetime.today()
if self._when_search_combo.props.value == _ACTION_TODAY:
date_range = (today_start, right_now)
elif self._when_search_combo.props.value == _ACTION_SINCE_YESTERDAY:
date_range = (today_start - timedelta(1), right_now)
elif self._when_search_combo.props.value == _ACTION_PAST_WEEK:
date_range = (today_start - timedelta(7), right_now)
elif self._when_search_combo.props.value == _ACTION_PAST_MONTH:
date_range = (today_start - timedelta(30), right_now)
elif self._when_search_combo.props.value == _ACTION_PAST_YEAR:
date_range = (today_start - timedelta(356), right_now)
return (time.mktime(date_range[0].timetuple()),
time.mktime(date_range[1].timetuple()))
def _combo_changed_cb(self, combo):
self._update_if_needed()
def __sort_changed_cb(self, button):
self._update_if_needed()
def _update_if_needed(self):
# check if the what_search combo should be visible
self._what_search_combo.set_visible(
self._filter_type != FILTER_TYPE_MIME_BY_ACTIVITY)
new_query = self._build_query()
if self._query != new_query:
self._query = new_query
self.emit('query-changed', self._query)
def _search_entry_activated_cb(self, search_entry):
if self._autosearch_timer:
GObject.source_remove(self._autosearch_timer)
self._update_if_needed()
def _search_entry_changed_cb(self, search_entry):
if not search_entry.props.text:
search_entry.activate()
return
if self._autosearch_timer:
GObject.source_remove(self._autosearch_timer)
self._autosearch_timer = GObject.timeout_add(_AUTOSEARCH_TIMEOUT,
self._autosearch_timer_cb)
def _autosearch_timer_cb(self):
logging.debug('_autosearch_timer_cb')
self._autosearch_timer = None
self.search_entry.activate()
return False
def set_mount_point(self, mount_point):
self._mount_point = mount_point
self._update_if_needed()