[pygtk] Detecting a clicked upon word in cellRendererText

Ben Shomer ben.shomer at gmail.com
Sat Nov 5 11:29:03 WST 2011


Hi All,

I have a TreeView with several columns. One of them holds a meaningful
text which is displayed by a cellRendererText.

I detect a clicking event on the TreeView:

         # Make the treeview event sensitive
         treeview.add_events(gtk.gdk.BUTTON_PRESS_MASK)
         treeview.connect('button_press_event',
self.streamview_button_press)

Then, I process the call.  Naturally, I have the event.x and event.y
available.

I would like to be able to detect which word in the text was clicked
upon (actually, I want to turn various parts of the text,
not only URLs, into hyperlinks)

Anyone has an idea how to do that?  I know how to do this with a
gtk.TextView by calling 
text_view.window_to_buffer_coords
but I haven't got a clue on how to do that with a text renderer. Is it
at all possible?

Thanks in advance for any input,

Ben.


* Relationship experts
* Tantra mentors
* Coaches in Sexuality, Personal development & Communication
* Workshops for groups and personal experiences

Tel: +972-54-4655868
Twitter: @BenAndEfrat    Facebook: BenAndEfrat    Skype:ben_and_efrat 

Please visit our homepage at http://benefrat.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20111105/2a9e46b8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_250_100_EN_2010.jpg
Type: image/jpeg
Size: 4469 bytes
Desc: not available
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20111105/2a9e46b8/attachment-0001.jpg>


More information about the pygtk mailing list