5 class Dialog(gtk
.Dialog
):
7 gtk
.Dialog
.__init
__(self
)
8 self
.set_has_separator(False)
9 self
.set_position(gtk
.WIN_POS_CENTER
)
11 def destroyed(widget
):
13 self
.connect('destroy', destroyed
)
20 def add_mixed_button(self
, message
, stock
, response
):
21 button
= MixedButton(message
, stock
)
22 button
.set_flags(gtk
.CAN_DEFAULT
)
24 self
.add_action_widget(button
, response
)
28 def alert(parent
, message
):
30 box
= gtk
.MessageDialog(parent
, gtk
.DIALOG_DESTROY_WITH_PARENT
,
31 gtk
.MESSAGE_ERROR
, gtk
.BUTTONS_OK
,
33 box
.set_position(gtk
.WIN_POS_CENTER
)
37 box
.connect('response', resp
)
41 def _one_less_window():
47 def wait_for_no_windows():
51 def MixedButton(message
, stock
):
55 label
.set_text_with_mnemonic(message
)
56 label
.set_mnemonic_widget(button
)
58 image
= gtk
.image_new_from_stock(stock
, gtk
.ICON_SIZE_BUTTON
)
59 box
= gtk
.HBox(False, 2)
60 align
= gtk
.Alignment(0.5, 0.5, 0.0, 0.0)
62 box
.pack_start(image
, False, False, 0)
63 box
.pack_end(label
, False, False, 0)