本文整理汇总了Python中kano.gtk3.scrolled_window.ScrolledWindow.get_style_context方法的典型用法代码示例。如果您正苦于以下问题:Python ScrolledWindow.get_style_context方法的具体用法?Python ScrolledWindow.get_style_context怎么用?Python ScrolledWindow.get_style_context使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kano.gtk3.scrolled_window.ScrolledWindow
的用法示例。
在下文中一共展示了ScrolledWindow.get_style_context方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _generate_grid
# 需要导入模块: from kano.gtk3.scrolled_window import ScrolledWindow [as 别名]
# 或者: from kano.gtk3.scrolled_window.ScrolledWindow import get_style_context [as 别名]
def _generate_grid(self):
row_count = int(math.ceil(
float(len(self._DISPLAYED_SCREENS)) / self._col_count)
)
table = Gtk.Table(row_count, self._col_count, homogeneous=True,
hexpand=True, vexpand=True)
table.props.margin = 0
for idx, screen in enumerate(self._DISPLAYED_SCREENS):
row = idx / 2
col = idx % 2
screen.create_menu_button(self._change_screen_cb)
if row % 2:
style_class = 'appgrid_grey'
else:
style_class = 'appgrid_white'
screen.menu_button.button.get_style_context().add_class(style_class)
screen.refresh_menu_button()
table.attach(screen.menu_button.button,
col, col + 1, row, row + 1,
Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND,
Gtk.AttachOptions.FILL, 0, 0)
scrolled_window = ScrolledWindow(wide_scrollbar=True, vexpand=True,
hexpand=True)
scrolled_window.get_style_context().add_class('app-grid')
scrolled_window.add_with_viewport(table)
return scrolled_window