def _clear_flowbox(self):
'''
Clear the contents of the flowbox
'''
for child in self._flowbox_scroll.get_children():
self._flowbox_scroll.remove(child)
self._flowbox = Gtk.FlowBox()
self._flowbox.get_style_context().add_class('view')
self._flowbox_scroll.add(self._flowbox)
self._flowbox.set_valign(Gtk.Align.START)
self._flowbox.set_min_children_per_line(1)
self._flowbox.set_max_children_per_line(100)
self._flowbox.set_row_spacing(0)
self._flowbox.set_column_spacing(0)
self._flowbox.set_activate_on_single_click(True)
self._flowbox.set_selection_mode(Gtk.SelectionMode.NONE)
self._flowbox.set_can_focus(False)
self._flowbox.set_homogeneous(False)
self._flowbox.set_hexpand(False)
self._flowbox.set_vexpand(False)
self._flowbox.connect('child-activated', self.on_emoji_selected)
for long_press_gesture in self._long_press_gestures:
# disconnecting is necessary to avoid warnings to stdout:
for ids in long_press_gesture[1]:
long_press_gesture[0].disconnect(ids)
self._long_press_gestures = []
评论列表
文章目录