Mercurial > libervia-backend
diff frontends/primitivus/xmlui.py @ 167:6fd053c99421
Primitivus: misc improvments on TabsContainer/FocusFrame
- FocusFrame: better management of keypress
- TabsContainer: new addFooter method, to add a widget on the bottom of the container
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 09 Aug 2010 21:58:28 +0800 |
parents | b318d2b58887 |
children | 2ea8dab08160 |
line wrap: on
line diff
--- a/frontends/primitivus/xmlui.py Mon Aug 09 21:39:41 2010 +0800 +++ b/frontends/primitivus/xmlui.py Mon Aug 09 21:58:28 2010 +0800 @@ -164,7 +164,7 @@ assert ret_wid.body if isinstance(ret_wid.body[0],custom_widgets.TabsContainer): - ret_wid = urwid.Pile([ret_wid.body[0]]) #xxx: awfull hack cause TabsContainer is a BoxWidget, can't be inside a ListBox + ret_wid = ret_wid.body[0] #xxx: awfull hack cause TabsContainer is a BoxWidget, can't be inside a ListBox if self.type == 'form': @@ -176,15 +176,13 @@ grid_wid = urwid.GridFlow(buttons,max_len+4,1,0,'center') ret_wid.body.append(grid_wid) elif self.type == 'param': - assert(isinstance(ret_wid,urwid.Pile)) + assert(isinstance(ret_wid,custom_widgets.TabsContainer)) buttons = [] buttons.append(custom_widgets.CustomButton(_('Save'),self.onSaveParams)) buttons.append(custom_widgets.CustomButton(_('Cancel'),lambda x:self.host.removeWindow())) max_len = max([button.getSize() for button in buttons]) grid_wid = urwid.GridFlow(buttons,max_len,1,0,'center') - ret_wid.widget_list.append(urwid.Filler(grid_wid)) - ret_wid.item_types.append(('weight',1)) - + ret_wid.addFooter(grid_wid) return ret_wid def show(self):