def _alert(self, title, text=None, timeout=5): alert = NotifyAlert(timeout=timeout) alert.props.title = title alert.props.msg = text self.add_alert(alert) alert.connect('response', self._alert_cancel_cb) alert.show()
def alert(self, title=None, text=None, delay=5): alert = NotifyAlert(delay) alert.props.title = title alert.props.msg = text self.add_alert(alert) alert.connect('response', self._alert_ok) alert.show()
def _alert(self, title, text=None): from sugar.graphics.alert import NotifyAlert alert = NotifyAlert(timeout=5) alert.props.title = title alert.props.msg = text self.add_alert(alert) alert.connect('response', self._alert_cancel_cb) alert.show()
def alert(self, title, text=None): """ Alert popup """ alert = NotifyAlert(timeout=10) alert.props.title = title alert.props.msg = text self._activity.add_alert(alert) alert.connect('response', self.alert_cancel_cb) alert.show()
def alert(self, title, text=None): '''Show an alert above the activity.''' try: alert = NotifyAlert(timeout=10) except NameError: logging.warning('sugar.graphics.alert.NotifyAlert not present for %r, %r', title, text) return alert.props.title = title alert.props.msg = text self.add_alert(alert) alert.connect('response', self.__alert_cancel_cb) alert.show()
def alert(self, title, text=None): '''Show an alert above the activity.''' try: alert = NotifyAlert(timeout=10) except NameError: logging.warning( 'sugar.graphics.alert.NotifyAlert not present for %r, %r', title, text) return alert.props.title = title alert.props.msg = text self.add_alert(alert) alert.connect('response', self.__alert_cancel_cb) alert.show()