panelview.py 文件源码

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

项目:zim-icontags-plugin 作者: Pl-M 项目源码 文件源码
def do_initialize_popup(self, menu):
        '''
        Disable some items in popup menu for only tagged pages mode.
        Although it is possible to leave it as is but it is not
        recommended to create or change page names since not all pages
        are shown.
        '''
        model = self.get_model()
        if not isinstance(model, gtk.TreeModelFilter):
            PageTreeView.do_initialize_popup(self, menu)
            return

        path = self.get_selected_path() or Path(':')

        item = gtk.MenuItem(_('Open in New Window'))
        item.connect('activate', lambda o: self.ui.open_new_window(path))
        menu.append(item)

        menu.append(gtk.SeparatorMenuItem())

        item = gtk.ImageMenuItem('gtk-copy')
        item.connect('activate', lambda o: self.do_copy())
        menu.append(item)

        self.populate_popup_expand_collapse(menu)
        menu.show_all()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号