本文整理汇总了Python中kano.gtk3.scrolled_window.ScrolledWindow.set_shadow_type方法的典型用法代码示例。如果您正苦于以下问题:Python ScrolledWindow.set_shadow_type方法的具体用法?Python ScrolledWindow.set_shadow_type怎么用?Python ScrolledWindow.set_shadow_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kano.gtk3.scrolled_window.ScrolledWindow
的用法示例。
在下文中一共展示了ScrolledWindow.set_shadow_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AppGrid
# 需要导入模块: from kano.gtk3.scrolled_window import ScrolledWindow [as 别名]
# 或者: from kano.gtk3.scrolled_window.ScrolledWindow import set_shadow_type [as 别名]
class AppGrid(Gtk.EventBox):
def __init__(self, main_win, apps_obj):
Gtk.EventBox.__init__(self, hexpand=True, vexpand=True)
style = self.get_style_context()
style.add_class('app-grid')
self._win = main_win
self._apps = apps_obj
self._num_apps = 0
self._sw = ScrolledWindow(hexpand=True, vexpand=True,
wide_scrollbar=True)
self._sw.props.margin_top = 7
self._sw.props.margin_bottom = 0
self._sw.props.margin_left = 0
self._sw.props.margin_right = 0
self._sw.props.border_width = 0
self._sw.set_shadow_type(Gtk.ShadowType.NONE)
self._box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self._sw.add_with_viewport(self._box)
self.add(self._sw)
def new_entry(self, app, sort_by="title", reverse=False):
if "colour" not in app:
if (self._num_apps % 2) == 0:
app["colour"] = "#f2914a"
else:
app["colour"] = "#f5a269"
self._num_apps += 1
entry = AppGridEntry(app, self._win, self._apps)
self._box.pack_start(entry, False, False, 0)
pos = 0
for child in self._box:
child_app_data = child.get_app_data()
# keep the special "want-more" entry at the bottom of the list
if "slug" in child_app_data and \
child_app_data["slug"] == "want-more":
break
if reverse:
if app[sort_by] > child_app_data[sort_by]:
break
else:
if app[sort_by] < child_app_data[sort_by]:
break
pos += 1
self._box.reorder_child(entry, pos)
entry.show_all()
return entry
def get_num(self):
return self._num_apps