blob: 238a00e6c565026e6a4a95f63cc38be8ed0c5c01 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/usr/bin/env python
import gtk
import atk
win = gtk.Window()
win.connect('destroy', lambda win: gtk.main_quit())
button = gtk.Button(stock=gtk.STOCK_QUIT)
button.connect('pressed', lambda button: gtk.main_quit())
atk_button = button.get_accessible()
atk_button.set_description('Be careful, clicking this button will exit')
label = gtk.Label('This label describes a button')
atk_label = label.get_accessible()
atk_label.set_description('This is a useless label')
relation_set = atk_label.ref_relation_set()
relation = atk.Relation((atk_button,), atk.RELATION_LABEL_FOR)
relation_set.add(relation)
box = gtk.HBox()
box.pack_start(label)
box.pack_start(button)
win.add(box)
win.show_all()
gtk.main()
|