Re: about adding pop menu in treeview

Why the Tree itself is not a subclass of FMDirectoryView? If it was, it could already use the popup menu, the icons, the emblems, etc.

Is this possible?

Alexander Larsson wrote:
On Thu, 2003-11-06 at 06:56, Zhiyuan Liu wrote:

I'am thinking about adding pop menu in treeview.
the nautilus architechture(2.4 version) is not perfect enough for us to add the enhancement of adding pop menu in treeview. But we really need this feature in our desktop linux distribution, so I'am planning implement this feature in following way, though it is not a satisfactory way.

1. make a class (say, call it FMSimPopmenuView) which inherits from FMDirectoryView, because FMDirectoryView supports almost all the file operations related to pop-memu, and also FMDirectoryView has it's own pop menu.
  the FMSimPopmenuView is invisible, so it works in background
2. pop up menu in treeview by doing some event simulation. that is , when we right-click some node in the treeview, the change location operation is not performed for treeview , the same is for other views such as FMDirectoryView/location bar etc. Instead , FMSimPopmenuView is made to change location to "the parent node of the selected node", and then is set selection to "the item coresponding to the selected node in the treeview". finally the popmenu for FMSimPopmenuView is activated

That sounds like a horrible hack, and such a change would never be
accepted to the upstream nautilus codebase.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Alexander Larsson Red Hat, Inc alexl redhat com alla lysator liu se He's a leather-clad flyboy rock star in drag. She's an enchanted cigar-chomping wrestler operating on the wrong side of the law. They fight crime!

Fabio Gomes de Souza <fabio gs2 com br> (+55 81 9127-0597)

|- IT Infrastructure :: Security :: Embedded systems :: Linux
`- Olinda, Brazil - +55 81 3492-7777 - negocios gs2 com br

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]