Mercurial > mamba
comparison mamba/widgets/toollist.py @ 480:90a59251c93b
Sort tools in level editor.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 17 Sep 2011 22:22:21 +0200 |
parents | 3f37e011c3b6 |
children | 5f26ba2402cc |
comparison
equal
deleted
inserted
replaced
479:3f37e011c3b6 | 480:90a59251c93b |
---|---|
7 class ToolListWidget(Container): | 7 class ToolListWidget(Container): |
8 """List of other widgets, with some paging trickery""" | 8 """List of other widgets, with some paging trickery""" |
9 | 9 |
10 def __init__(self, rect, widget_list, page_length, start_key=K_1, | 10 def __init__(self, rect, widget_list, page_length, start_key=K_1, |
11 padding=2): | 11 padding=2): |
12 widget_list.sort(key=lambda w: w.text) | |
12 self.widget_list = widget_list | 13 self.widget_list = widget_list |
13 self.page_length = page_length | 14 self.page_length = page_length |
14 self.padding = padding | 15 self.padding = padding |
15 self.page = 0 | 16 self.page = 0 |
16 self.start_key = start_key | 17 self.start_key = start_key |