main_window.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Ebook-Viewer 作者: michaldaniel 项目源码 文件源码
def __on_copy_activate(self, widget):
        """
        Provides dirty clipboard hack to get selection from inside of WebKit
        :param widget:
        """
        primary_selection = Gtk.Clipboard.get(Gdk.SELECTION_PRIMARY)
        selection_clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
        # It does wait some short time for that text, it seems to update every now and then
        # Can get selection from anywhere in the system, no real way to tell
        selection_clipboard.set_text(primary_selection.wait_for_text(), -1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号