You are not logged in.

#1 2011-04-29 05:44:19

jiehong
Member
Registered: 2009-03-19
Posts: 63
Website

[SOLVED] PyGTK: select a line in a textbuffer on mouse clic

Hello!

I am working on a dictionary using CEDICT in pyhton+GTK and on the GUI I have a textbuffer which I use to display some candidates after a word is looked up and I would like to let the user to clic a candidate to display the corresponding translation. Therefore I want to get the whole line of the text buffer on which the mouse has clicked (in order to highlight it to let the user know it and to get the corresponding string to display the right translation).

But I haven't found out how to deal with that so I just hope someone can help me.

By the way the textbuffer is set as not editable and the cursor isn't visible. I thought I could use the position of the cursor to select the current line in which the cursor is but I don't really know how to do so...

I would be very happy if someone could give me a hand smile

Last edited by jiehong (2011-05-01 09:00:07)

Offline

#2 2011-05-01 08:59:37

jiehong
Member
Registered: 2009-03-19
Posts: 63
Website

Re: [SOLVED] PyGTK: select a line in a textbuffer on mouse clic

Ok, I've found out that it would be more suitable to use a ListStore which is more designed for that… so, let's say SOLVED…

Offline

Board footer

Powered by FluxBB