本文整理汇总了Python中dtk.ui.dialog.DialogBox.set_keep_above方法的典型用法代码示例。如果您正苦于以下问题:Python DialogBox.set_keep_above方法的具体用法?Python DialogBox.set_keep_above怎么用?Python DialogBox.set_keep_above使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dtk.ui.dialog.DialogBox
的用法示例。
在下文中一共展示了DialogBox.set_keep_above方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_unmodifier_key
# 需要导入模块: from dtk.ui.dialog import DialogBox [as 别名]
# 或者: from dtk.ui.dialog.DialogBox import set_keep_above [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()
示例2: resolve_accel_entry_conflict
# 需要导入模块: from dtk.ui.dialog import DialogBox [as 别名]
# 或者: from dtk.ui.dialog.DialogBox import set_keep_above [as 别名]
def resolve_accel_entry_conflict(origin_entry, conflict_entry, tmp_accel_buf):
dialog = DialogBox(" ", 620, 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\" is already used for \"%s\"")%
(tmp_accel_buf.get_accel_label(), conflict_entry.settings_description), enable_select=False, enable_double_click=False)
label2 = Label(_("If you reassign the shortcut to \"%s\", the \"%s\" shortcut will be disabled.")%
(origin_entry.settings_description, conflict_entry.settings_description), enable_select=False, enable_double_click=False)
dialog.body_box.pack_start(label1)
dialog.body_box.pack_start(label2)
button_reassign = Button(_("Reassign"))
button_cancel = Button(_("Cancel"))
button_cancel.connect("clicked", lambda b: origin_entry.reassign_cancel(dialog))
button_reassign.connect("clicked", lambda b: origin_entry.reassign(tmp_accel_buf, conflict_entry, dialog))
dialog.right_button_box.set_buttons([button_cancel, button_reassign])
dialog.show_all()
示例3: ShareToWeibo
# 需要导入模块: from dtk.ui.dialog import DialogBox [as 别名]
# 或者: from dtk.ui.dialog.DialogBox import set_keep_above [as 别名]
class ShareToWeibo(object):
'''share picture to weibo'''
def __init__(self, filename=""):
'''
init share
@param filename: the file to share
'''
self.upload_image = filename
self.thumb_width = 188
self.thumb_height = 168
self.MAX_CHAR = 140
#self.__text_frame_color = (0.76, 0.76, 0.76)
self.__win_width = 602
open(COOKIE_FILE,'wb').close()
self.window = DialogBox(_("Share to social networks"), close_callback=gtk.main_quit)
self.window.set_keep_above(True)
self.window.set_size_request(self.__win_width+20, 288)
self.window.set_resizable(False)
self.window.titlebar.connect("expose-event", self.__expose_top_and_bottome)
self.window.button_box.connect("expose-event", self.__expose_top_and_bottome)
# create slider
self.slider = HSlider()
self.slider_list = []
self.share_box = gtk.VBox(False, 2) # first page, input context
self.web_box = gtk.VBox(False, 10) # second page, login
self.result_box = gtk.VBox(False, 10) # third page, share result
share_align = gtk.Alignment()
share_align.set(0.5, 0.5, 0, 0)
share_align.add(self.share_box)
share_align.connect("expose-event", self.__slider_expose)
# go back button
web_left_button = ImageButton(
app_theme.get_pixbuf("share/back_normal.png"),
app_theme.get_pixbuf("share/back_hover.png"),
app_theme.get_pixbuf("share/back_press.png"))
web_left_button.connect("clicked", lambda w: self.set_slide_index(0))
web_left_button.set_can_focus(False)
utils.set_clickable_cursor(web_left_button)
# show url entry
self.web_url_entry = InputEntry()
self.web_url_entry.set_editable(False)
self.web_url_entry.set_size(555, 20)
self.web_url_entry.entry.right_menu_visible_flag = False
# alig url entry
web_navigate_vbox = gtk.VBox(False)
web_navigate_vbox.pack_start(self.web_url_entry)
web_navigate_t_align = gtk.Alignment()
web_navigate_t_align.set(0.0, 0.5, 0, 0)
web_navigate_t_align.add(web_navigate_vbox)
# pack back button and url entry
web_navigate_box = gtk.HBox(False, 7)
web_navigate_box.pack_start(web_left_button, False, False)
web_navigate_box.pack_start(web_navigate_t_align)
web_navigate_align = gtk.Alignment()
web_navigate_align.set(0.5, 0.5, 0, 0)
web_navigate_align.set_padding(4, 0, 11, 13)
web_navigate_align.add(web_navigate_box)
# create a webkit
self.web_view = WebView(COOKIE_FILE)
self.web_view.connect("notify::load-status", self.web_view_load_status)
self.web_view.connect("load-error", self.web_view_load_error)
self.web_scrolled_window = ScrolledWindow()
self.web_scrolled_window.add(self.web_view)
self.web_scrolled_window.set_size_request(590, 228)
self.web_box.pack_start(web_navigate_align, False, False)
self.web_box.pack_start(self.web_scrolled_window)
#self.web_box.set_size_request(-1, 258)
web_align = gtk.Alignment()
web_align.set(0.5, 0.0, 0, 1)
web_align.add(self.web_box)
web_align.connect("expose-event", self.__slider_expose)
res_align = gtk.Alignment()
res_align.set(0.5, 0.5, 0, 0)
res_align.add(self.result_box)
res_align.connect("expose-event", self.__slider_expose)
self.slider.set_to_page(share_align)
self.slider_list.append(share_align)
self.slider_list.append(web_align)
self.slider_list.append(res_align)
self.__weibo_list = []
self.sina = weibo.Sina(self.web_view)
self.qq = weibo.Tencent(self.web_view)
self.twitter = weibo.Twitter(self.web_view)
self.__weibo_list.append(self.sina)
self.__weibo_list.append(self.qq)
self.__weibo_list.append(self.twitter)
self.__current_weibo = None
self.window.body_box.pack_start(self.slider, True, True)
#.........这里部分代码省略.........