Mercurial > libervia-backend
comparison frontends/src/primitivus/xmlui.py @ 1610:1378ec04380f
primitivus (xmlui): fixed closing on popup panel "OK" button press
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 16 Nov 2015 09:25:05 +0100 |
parents | 641cfd2faefe |
children | 48f324352c52 |
comparison
equal
deleted
inserted
replaced
1609:66f0e877625b | 1610:1378ec04380f |
---|---|
404 if self.type == 'form': | 404 if self.type == 'form': |
405 buttons.append(urwid.Button(_('Submit'), self.onFormSubmitted)) | 405 buttons.append(urwid.Button(_('Submit'), self.onFormSubmitted)) |
406 if not 'NO_CANCEL' in self.flags: | 406 if not 'NO_CANCEL' in self.flags: |
407 buttons.append(urwid.Button(_('Cancel'), self.onFormCancelled)) | 407 buttons.append(urwid.Button(_('Cancel'), self.onFormCancelled)) |
408 else: | 408 else: |
409 buttons.append(urwid.Button(_('OK'))) | 409 buttons.append(urwid.Button(_('OK'), on_press=lambda dummy: self._xmluiClose())) |
410 max_len = max([len(button.get_label()) for button in buttons]) | 410 max_len = max([len(button.get_label()) for button in buttons]) |
411 grid_wid = urwid.GridFlow(buttons, max_len + 4, 1, 0, 'center') | 411 grid_wid = urwid.GridFlow(buttons, max_len + 4, 1, 0, 'center') |
412 self.main_cont.body.append(grid_wid) | 412 self.main_cont.body.append(grid_wid) |
413 elif self.type == 'param': | 413 elif self.type == 'param': |
414 tabs_cont = self.main_cont.body[0].base_widget | 414 tabs_cont = self.main_cont.body[0].base_widget |