Re: Selecting text in a GtkTreeView widget



Dear Azrael,

Thanks for the response.

I assume if there is text in the widget, that it must be possible to
obtain the text via a function call.. and if not, you could always
set_data the widget with the text as well and then use get_data to get
it back again (or whatever the exact set and get data functions are).

Correct assumption.

Then you could attach a signal to the GtkTreeView cell that checks for
the widget text being highlighted.. I assume you can anyway.
Or if not you can at least check to see if the mouse has been pressed
down on it, if the mouse has been dragged over it, and if the mouse has
been released on it.. and you could use those to simulate checking for
highlight. The callback function could then get_data or otherwise get
the text, and manually feed it into the copy/paste buffer - again, not
sure how to do this.. but am assuming there is a way.

Either the entire cell is selected, or none of the cell is selected (unless the
cell is editable).  I can connect callbacks on a mouse click and release, but I
don't think that the position of the cursor within the cell is available. Also,
the entire cell is highlighted, not just the selected text.
 
Perhaps this isn't exactly what you asked for.. but if no-one else can
give you a suitable answer, it might be worth thinking about this sort
of thing.

I'm thinking of doing something with an editable cell, in which the selected
text is highlighted.  Maybe I can connect a callback to the renderer on the
"edited" signal.  The callback can figure out which row was edited, and can
refresh the text, making it look like the text cannot be altered.  I'm not
sure what the "edited" signal means; if it isn't appropriate, I'll check
out "columns-changed" for GtkTreeView.

Thanks for the help,
Alban





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