def onhover(self, widget, path, submenu):
'''
When the user hovers a folder item replace the dummy separator with the
actual content of the folder.
'''
submenu = gtk.Menu()
widget.set_submenu(submenu)
self.append_item(submenu, os.path.join(path, "."))
list_dirs = get_subdirs(path)
list_files = get_subfiles(path)
if len(list_dirs) or len(list_files):
self.append_separator(submenu)
for d in sorted(list_dirs):
self.append_item(submenu, os.path.join(path, d))
if len(list_dirs) and len(list_files):
self.append_separator(submenu)
for f in sorted(list_files):
self.append_item(submenu, os.path.join(path, f))
bookmarks-indicator.py 文件源码
python
阅读 15
收藏 0
点赞 0
评论 0
评论列表
文章目录