Advertisement
Guest User

Help for ash

a guest
Jan 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. def on_search_changed(self, search_text):
  2.   if not search_text:
  3.     self.set_visible_child(self.notebook)
  4.     return
  5.  
  6.   self.set_visible_child(self.search_results_wrapper)
  7.  
  8.   for child in self.search_results.get_children():
  9.     self.search_results.remove(child)
  10.  
  11.   # Create temporary list of buttons that match the search text
  12.   buttons = []
  13.   for category, categorydata in EmojiData.data.items():
  14.     for emoji in categorydata:
  15.       if search_text in emoji.get("name"):
  16.         buttons.append(button)
  17.  
  18.   # Sort the temp. list
  19.   sorted_buttons = sort(buttons)
  20.  
  21.   # Then re-add them back to your search_results
  22.   for button in sorted_buttons:
  23.     self.search_results.add(button)
  24.     button.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement