I was wondering how I would search text in a textview and change the colour of it(Like syntax highlighting). I already have a basic text editor written with save/load functions.
Im using monodevelop in gtk#.
Thanks a lot —
Adrian
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I will use gtk api nomenclature here, there should be gtk# equivalents.
For search, GtkTextIter has a forward and backward search method, and is meant to be used with GtkTextView/GtkTextBuffer.
For syntax highlighting, you might investigate GtkSourceView, and its c# wrapper, it has all of the syntax highlighting infrastructure in place. It’s also a subclass of GtkTextView, so GtkTextIter will work with it.