Customizing mouse functionality
Hi Tiago, I was wondering if there is a way to customize what happens when a mouse button is clicked. In particular I am interested in the following: 1) Disabling the feature that allows user to move vertices around by using the mouse 2) Any callbacks that might be available when a mouse button is pressed/released 3) If you could point out the part of your code (name of file/function) that is being called upon a mouse click (that would be the code that gets the screen coordinates and from there extracts which vertex has been selected). Thanks in advance, Vaggelis -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
On 27.10.2015 22:40, Evangelos Petsalis wrote:
Hi Tiago, I was wondering if there is a way to customize what happens when a mouse button is clicked.
In particular I am interested in the following: 1) Disabling the feature that allows user to move vertices around by using the mouse 2) Any callbacks that might be available when a mouse button is pressed/released 3) If you could point out the part of your code (name of file/function) that is being called upon a mouse click (that would be the code that gets the screen coordinates and from there extracts which vertex has been selected).
You need to take a look at the GraphWidget class: https://graph-tool.skewed.de/static/doc/draw.html#graph_tool.draw.GraphWidge... clicking at the [source] link will show you the source. You will need either to subclass or modify it to achieve what you want. Sorry, but the documentation is still a bit scarce in this part, so you will need to wad through the source code. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
Evangelos Petsalis -
Tiago de Paula Peixoto