本文整理汇总了Python中kano.gtk3.scrolled_window.ScrolledWindow.set_placement方法的典型用法代码示例。如果您正苦于以下问题:Python ScrolledWindow.set_placement方法的具体用法?Python ScrolledWindow.set_placement怎么用?Python ScrolledWindow.set_placement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kano.gtk3.scrolled_window.ScrolledWindow
的用法示例。
在下文中一共展示了ScrolledWindow.set_placement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from kano.gtk3.scrolled_window import ScrolledWindow [as 别名]
# 或者: from kano.gtk3.scrolled_window.ScrolledWindow import set_placement [as 别名]
def __init__(self, parser):
# for some reason, this is not being obeyed
self.item_width = 55
self.item_height = 50
self._signal_name = 'category_item_selected'
self._parser = parser
# Initialise self._items
self._items = {}
# Save the order of the categories so we can use it outside
self.categories = self._parser.list_available_categories()
SelectMenu.__init__(self, self.categories, self._signal_name)
# Add the scrollbar for the category menu
sw = ScrolledWindow()
sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
# Set the scrollbar to the left
sw.set_placement(Gtk.CornerType.TOP_RIGHT)
sw.apply_styling_to_widget()
sw.set_size_request(-1, 364)
self.add(sw)
self._vertbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
sw.add(self._vertbox)
# The menu is one item by 7 items
self.set_size_request(self.item_width, 7 * self.item_height)
self._pack_buttons()