2

I am hacking some code within the gtk3 sources.

Now everyone knows that, then you make a selection, the selected text is highlighted by showing it in white on a (usually) orange background.

The question is, where is the code that actually causes this highlighting to happen? I have searched and googled, and I cannot find it anywhere. Is in GDK, or in Pango, or where else? I cannot even find where in gtk the instruction is issued. I have tried catching it in GDB, and it would seem to happen by sending a signal to somebody who then performs it. But I have not caught it in the act, so where is it?

What I am trying to do is to make a secondary selection, which I have succeeded in doing (by double clicking or dragging), but I have to do it blind because I cannot manage to highlight it.

1 Answers1

0

If you have your selection bounds as GtkTextMarks, then you can highlight the range between them using a GtkTextTag with the appropriate foreground and background color set. I don't think this will work if the regular and secondary selections overlap, though.

ptomato
  • 56,175
  • 13
  • 112
  • 165