2 from gtk
import gdk_beep
9 def process_next(widget
= None, process_next
= None):
11 current_alarm
= Alarm(alarms
[0])
13 current_alarm
.connect('destroy', process_next
)
14 memos
.memo_list
.save()
18 if current_alarm
== None:
19 process_next(process_next
= process_next
)
21 class Alarm(GtkWindow
):
22 def __init__(self
, memo
):
23 GtkWindow
.__init
__(self
, WINDOW_DIALOG
)
24 self
.set_title('Memo:')
26 self
.set_position(WIN_POS_CENTER
)
27 self
.set_border_width(2)
31 vbox
= GtkVBox(FALSE
, 0)
34 message
= GtkLabel(memo
.message
)
35 message
.set_line_wrap(TRUE
)
36 text_container
= GtkEventBox()
37 text_container
.set_border_width(40)
38 text_container
.add(message
)
39 vbox
.pack_start(text_container
, TRUE
, TRUE
, 0)
41 action_area
= GtkHBox(TRUE
, 5)
42 action_area
.set_border_width(2)
43 vbox
.pack_start(GtkHSeparator(), FALSE
, TRUE
, 2)
44 vbox
.pack_start(action_area
, FALSE
, TRUE
, 0)
47 for b
in ['Remove', 'Silence', 'Edit']:
49 label
.set_padding(16, 2)
52 button
.set_flags(CAN_DEFAULT
)
53 action_area
.pack_start(button
, TRUE
, TRUE
, 0)
54 button
.connect('clicked', self
.button
, b
)
55 if not default_button
:
56 default_button
= button
58 default_button
.grab_focus()
59 default_button
.grab_default()
60 action_area
.set_focus_child(default_button
)
64 def button(self
, button
, text
):
67 memos
.memo_list
.delete(self
.memo
)
69 memos
.edit_memo(self
.memo
)