本文整理汇总了Python中view.View.queue_draw方法的典型用法代码示例。如果您正苦于以下问题:Python View.queue_draw方法的具体用法?Python View.queue_draw怎么用?Python View.queue_draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view.View
的用法示例。
在下文中一共展示了View.queue_draw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: UPDF
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import queue_draw [as 别名]
#.........这里部分代码省略.........
pages = sorted(pages, reverse=True)
for num_page in pages:
self.miniview.remove_page(num_page - 1)
self.label1.set_text(_(" / %s ") % (str(self.miniview.get_number_of_pages())))
spd.destroy()
elif option == "extract_pages":
spd = ExtractPagesDialog(self)
if spd.run() == Gtk.ResponseType.ACCEPT:
pages = spd.get_pages()
option_remove = spd.get_remove()
spd.destroy()
pages = sorted(pages, reverse=False)
self.save_pages_as_pdf(pages)
if option_remove:
pages = sorted(pages, reverse=True)
for num_page in pages:
self.miniview.remove_page(num_page - 1)
self.label1.set_text(_(" / %s ") % (str(self.miniview.get_number_of_pages())))
spd.destroy()
elif option == "copy":
if (
self.view.tool == "arrow"
and self.view.mouse_down == None
and self.view.selection_end
and self.view.selection_start
):
self.view.copy_to_pixbuf()
elif option == "paste":
if self.view.tool == "arrow":
self.view.paste_from_pixbuf()
def on_resize(self, widget, data):
self.view.is_plotted = False
self.view.queue_draw()
def on_view_key_pressed(self, widget, event):
if self.view.tool and self.view.tool == "text":
if event.keyval >= 32 and event.keyval <= 126 or event.keyval >= 127 and event.keyval <= 255:
if event.keyval == 32:
self.view.text += " "
else:
self.view.text += unichr(Gdk.keyval_to_unicode(event.keyval))
self.view.queue_draw()
elif event.keyval == 65288: # backspace
self.view.text = self.view.text[:-1]
self.view.queue_draw()
elif event.keyval == 65293 or event.keyval == 65421: # return
self.view.write()
elif event.keyval in range(65456, 65466):
self.view.text += str(event.keyval - 65456)
self.view.queue_draw()
else:
print(event.keyval)
print(Gdk.keyval_name(event.keyval))
else:
if event.keyval == 65361:
self.goto_page(0)
elif event.keyval == 65362 or event.keyval == 65360:
self.goto_page(self.miniview.get_number_of_selected_page() - 1)
elif event.keyval == 65363:
self.goto_page(self.miniview.get_number_of_pages() - 1)
elif event.keyval == 65364 or event.keyval == 65367:
self.goto_page(self.miniview.get_number_of_selected_page() + 1)
elif event.keyval == 65451 or event.keyval == 43:
self.view.zoom_in()