Open FJuedesOrcl opened 11 months ago
@FJuedesOrcl
// SetMouseCapture sets a function which captures mouse events (consisting of
// the original tcell mouse event and the semantic mouse action) before they are
// forwarded to the primitive's default mouse event handler. This function can
// then choose to forward that event (or a different one) by returning it or
// returning a nil mouse event, in which case the default handler will not be
// called.
So this is how it works. The comment doc even states that it is meant to be a handler to choose whether or not the mouse event should be passed on to the primitives default mouse event handler
, which is the one that is built into the TreeView
primitive.
If you want to be able to handle more events then what the default primitive is capable of handling, then you need to think about creating a new primtive, or subclassing/embedding the treeview widget.
The wiki describes how to create your own primitive. THen you would be utilizing 'WrapMouseHandler' and 'WrapInputHandler' instead of the global Capture handler that is on the Box
primitive.
Also what if you want to make a modal dialog box, and have the MouseCapture force all events to the modal, so it can detect if any clicks were made outside of it to dismiss it? It is just another feature, albeit probably not what you are looking for in this use case.
Hi Friends,
i am not sure if this is intentional, by mistake or technically unavoidable:
Am i doing something wrong? - Please have a look at the code below. Another question arose while writing the short experimental code: How can one map the mouse-event coordinates to a TUI-element? I am using flexible-grid dimensions, so that the dimensions of the elements are depending on the size of the terminal window.
Any hints and recommendations very welcomed!
Best regards from Charleston (WV), Frank/2
Here is the sample code: