diff options
Diffstat (limited to 'examples/alert.py')
-rw-r--r-- | examples/alert.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/alert.py b/examples/alert.py new file mode 100644 index 0000000..4eda9ce --- /dev/null +++ b/examples/alert.py @@ -0,0 +1,25 @@ +from gi.repository import Gtk + +from sugar3.graphics.alert import Alert, TimeoutAlert + +def _destroy_cb(widget, data=None): + Gtk.main_quit() + +def __start_response_cb(widget, data=None): + print 'Response: start download' + +w = Gtk.Window() +w.connect("destroy", _destroy_cb) + +box = Gtk.VBox() +w.add(box) + +alert = TimeoutAlert(9) +alert.props.title = 'Download started' +alert.props.msg = 'Sugar' +box.pack_start(alert, False, False, 0) +alert.connect('response', __start_response_cb) + +w.show_all() + +Gtk.main() |