Project

General

Profile

Right clic on WTreeNode

Added by Hyeoni Hwasoo about 10 years ago

Hi,

I'm using a WTree with WTreeNode. Is it possible to open a contextual menu (via WPopupMenu i presume) on a right clic on a WTreeNode ?

The WTree::itemSelectionChanged() doesn't send the clic of the mouse (whereas the private onClick method got it but that information is not propagated).

Regards


Replies (3)

RE: Right clic on WTreeNode - Added by Hyeoni Hwasoo about 10 years ago

Maybe should i use WTreeView instead of WTree ?

(I saw the WTreeView Drag & Drop example)

RE: Right clic on WTreeNode - Added by Koen Deforche about 10 years ago

Hey,

Using WTreeNode you can do this by for example listening on right mouse click with node~~label()>clicked() or even nodelabelArea()~~>clicked()

Regards,

koen

[Solved] RE: Right clic on WTreeNode - Added by Hyeoni Hwasoo about 10 years ago

Thank you Koen for your answer. I saw the example and the following code works :

1. WTree : http://www.webtoolkit.eu/wt/src?wtd=KvackzfMYSFuF20jemMynA9kSPzsZemd

tree->setAttributeValue

("oncontextmenu",

"event.cancelBubble = true; event.returnValue = false; return false;");

2. WTreeNode :

node~~label()~~>mouseWentUp.connect()

Regards,

Hyeon

    (1-3/3)