5 class Dialog(gtk
.Dialog
):
8 gtk
.Dialog
.__init
__(self
)
9 self
.set_has_separator(False)
10 self
.set_position(gtk
.WIN_POS_CENTER
)
12 def destroyed(widget
):
17 self
.connect('destroy', destroyed
)
21 def add_mixed_button(self
, message
, stock
, response
):
25 label
.set_text_with_mnemonic(message
)
26 label
.set_mnemonic_widget(button
)
28 image
= gtk
.image_new_from_stock(stock
, gtk
.ICON_SIZE_BUTTON
)
29 box
= gtk
.HBox(False, 2)
30 align
= gtk
.Alignment(0.5, 0.5, 0.0, 0.0)
32 box
.pack_start(image
, False, False, 0)
33 box
.pack_end(label
, False, False, 0)
37 button
.set_flags(gtk
.CAN_DEFAULT
)
39 self
.add_action_widget(button
, response
)
42 def alert(parent
, message
):
43 box
= gtk
.MessageDialog(parent
, gtk
.DIALOG_DESTROY_WITH_PARENT
,
44 gtk
.MESSAGE_ERROR
, gtk
.BUTTONS_OK
,
46 box
.set_position(gtk
.WIN_POS_CENTER
)
47 box
.connect('response', lambda b
, r
: box
.destroy())