sugar-toolkit-gtk3/examples/alert.py
Simon Schampijer b9a19e952f Add examples for Alert, Animator, ComboBox, IconEntry and Notebook
Signed-off-by: Simon Schampijer <simon@schampijer.de>
[squashed two patches into one]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
2011-12-13 17:19:53 -03:00

26 lines
507 B
Python

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()