5

I'm displaying some data as a TreeView. How can I detect a click on a particular tree-view cell, so that I know which column of which row was clicked on?

This is what I want to do, so maybe there's a better way: Part of the data is a series of True/False values indicating a particular set of options. For example, the options might be picking any of the options "Small, Medium, Large, X-Large" to be display. If the user selects "Small" and "Large", then the cell should display "Small, Large". I don't want to give each a separate column since there are actually like 20 options, and only 2 or 3 will be selected at any point.

When the user clicks on the cell, I want to display a pop-up with a bunch of checkboxes. The user can then select what s/he wants and submit the changes, at which point the cell's value should be updated.

The easiest way I thought of doing this would be to just detect a click (or a double-click) on the cell. Then I could pop up the window, and have the submit button of the window do what I want.

2 Answers 2

6

The row-activated signal is sent when a GTK TreeView row is double-clicked.

Sign up to request clarification or add additional context in comments.

1 Comment

It wasn't obvious to me that this answered the "How can I detect a click on a particular tree-view cell, so that I know which column of which row was clicked on?" question, since the signal is row-activated and doesn't obviously indicate the column. The docs for row-activated describe the user function, which gets passed the tree view and path (enough to determine the row), the column and any user data.
0

Ah from this grea tutorial and the API docs, I can just connect to the row-activated event, which will give me all the information I need.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.