简体   繁体   中英

How would I search text in a textview using gtk# and mono?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM