Mercurial > libervia-backend
comparison frontends/src/primitivus/card_game.py @ 607:c123dddaea6b
primitivus: fixed urwid issues with recent urwid versions
fix bug 18
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 24 Feb 2013 13:57:37 +0100 |
parents | 952322b1d490 |
children | 84a6e83157c2 |
comparison
equal
deleted
inserted
replaced
606:21ddafccf32d | 607:c123dddaea6b |
---|---|
109 def update(self, hand): | 109 def update(self, hand): |
110 """Update the hand displayed in this widget | 110 """Update the hand displayed in this widget |
111 @param hand: list of Card""" | 111 @param hand: list of Card""" |
112 del self.columns.widget_list[:] | 112 del self.columns.widget_list[:] |
113 del self.columns.column_types[:] | 113 del self.columns.column_types[:] |
114 self.columns.widget_list.append(urwid.Text('')) | 114 self.columns.contents.append((urwid.Text(''),('weight',1, False))) |
115 self.columns.column_types.append(('weight',1)) | |
116 for card in hand: | 115 for card in hand: |
117 widget = CardDisplayer(card) | 116 widget = CardDisplayer(card) |
118 self.columns.widget_list.append(widget) | 117 self.columns.widget_list.append(widget) |
119 self.columns.column_types.append(('fixed',3)) | 118 self.columns.column_types.append(('fixed',3)) |
120 urwid.connect_signal(widget, 'click', self.__onClick) | 119 urwid.connect_signal(widget, 'click', self.__onClick) |
121 self.columns.widget_list.append(urwid.Text('')) | 120 self.columns.contents.append((urwid.Text(''),('weight',1, False))) |
122 self.columns.column_types.append(('weight',1)) | |
123 self.columns.set_focus(1) | 121 self.columns.set_focus(1) |
124 | 122 |
125 def __onClick(self,card_wid): | 123 def __onClick(self,card_wid): |
126 self._emit('click', card_wid) | 124 self._emit('click', card_wid) |
127 | 125 |