Programming Help. Determing what line the user clicks in GtkText



Hi,

I'm using gtk+ 1.2.10 on RedHat 7.1. I'm trying to display text in a 
scrollable window, then get a callback when the user clicks on the text.
I did that by using a GtkText widget and connecting it to the 
"button-press-event" signal. That gives me the callback when I want
it, but I can't figure out what line the user clicked on. I tried
using the GList textWidget->current_line and counting till I got to
the start of the list which almost work. It gave me the previous line
that was clicked on. Does anyone have any ideas of the best way to do
what I want? I'm not opposed to modifying gtktext.c or using a different
widget. I realize that Gtk+2.0 will have a lot of changes in the text
area, but I don't know if it is in usable form yet. Some other requirements
I need is the ability to highlight different lines. I'm trying to
write a TMS320C54x DSP simulator under the GPL license.

Thanks for any help

Kerry 

-- 
Windows 95: n.
 32 bit extensions and a graphical shell for a 16 bit patch to an
 8 bit operating system originally coded for a 4 bit microprocessor,
 written by a 2 bit company, that can't stand 1 bit of competition.





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