本文整理匯總了Python中dtk.ui.dialog.DialogBox.destroy方法的典型用法代碼示例。如果您正苦於以下問題:Python DialogBox.destroy方法的具體用法?Python DialogBox.destroy怎麽用?Python DialogBox.destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dtk.ui.dialog.DialogBox
的用法示例。
在下文中一共展示了DialogBox.destroy方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: process_unmodifier_key
# 需要導入模塊: from dtk.ui.dialog import DialogBox [as 別名]
# 或者: from dtk.ui.dialog.DialogBox import destroy [as 別名]
def process_unmodifier_key(tmp_accel_buf):
dialog = DialogBox(" ", 550, 150)
dialog.window_frame.connect("expose-event", draw_widget_background)
dialog.set_keep_above(True)
dialog.set_modal(True)
dialog.body_align.set_padding(15, 10, 10, 10)
label1 = Label(_("The shortcut \"%s\" cannot be used because it will become impossible to type using this key.")% tmp_accel_buf.get_accel_label(), enable_select=False, enable_double_click=False)
label2 = Label(_("Please try with a key such as Control, Alt or Shift at the same time."), enable_select=False, enable_double_click=False)
dialog.body_box.pack_start(label1)
dialog.body_box.pack_start(label2)
button = Button(_("Cancel"))
button.connect("clicked", lambda b: dialog.destroy())
dialog.right_button_box.set_buttons([button])
dialog.show_all()