Maintainer | gtk2hs-users@lists.sourceforge.net |
---|---|
Stability | provisional |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
- data SourceMark
- class TextMarkClass o => SourceMarkClass o
- castToSourceMark :: GObjectClass obj => obj -> SourceMark
- sourceMarkNew :: GlibString string => Maybe string -> string -> IO SourceMark
- sourceMarkGetCategory :: (SourceMarkClass mark, GlibString string) => mark -> IO string
- sourceMarkNext :: (SourceMarkClass mark, GlibString string) => mark -> Maybe string -> IO (Maybe SourceMark)
- sourceMarkPrev :: (SourceMarkClass mark, GlibString string) => mark -> Maybe string -> IO (Maybe SourceMark)
- sourceMarkCategory :: (SourceMarkClass mark, GlibString string) => Attr mark string
Description
A SourceMark
marks a position in the text where you want to display additional info. It is based
on TextMark
and thus is still valid after the text has changed though its position may change.
SourceMarks
are organised in categories which you have to set when you create the mark. Each
category can have a pixbuf and a priority associated using gtkSourceViewSetMarkCategoryPixbuf
and gtkSourceViewSetMarkCategoryPriority
. The pixbuf will be displayed in the margin at the
line where the mark residents if the showLineMarks
property is set to True
. If there are
multiple marks in the same line, the pixbufs will be drawn on top of each other. The mark with the
highest priority will be drawn on top.
Types
data SourceMark Source
class TextMarkClass o => SourceMarkClass o Source
Methods
castToSourceMark :: GObjectClass obj => obj -> SourceMark Source
:: GlibString string | |
=> Maybe string |
|
-> string |
|
-> IO SourceMark |
Creates a text mark. Add it to a buffer using textBufferAddMark
. If name is Nothing
, the mark
is anonymous; otherwise, the mark can be retrieved by name using
textBufferGetMark
. Normally marks are created using the utility function
sourceBufferCreateMark
.
:: (SourceMarkClass mark, GlibString string) | |
=> mark | |
-> IO string | returns the category of the |
Returns the mark category
:: (SourceMarkClass mark, GlibString string) | |
=> mark | |
-> Maybe string |
|
-> IO (Maybe SourceMark) | returns the next |
Returns the next SourceMark
in the buffer or Nothing
if the mark was not added to a buffer. If there
is no next mark, Nothing
will be returned.
If category is Nothing
, looks for marks of any category
:: (SourceMarkClass mark, GlibString string) | |
=> mark | |
-> Maybe string |
|
-> IO (Maybe SourceMark) | returns the previous |
Returns the previous SourceMark
in the buffer or Nothing
if the mark was not added to a buffer. If
there is no previous mark, Nothing
is returned.
If category is Nothing
, looks for marks of any category
Attributes
sourceMarkCategory :: (SourceMarkClass mark, GlibString string) => Attr mark string Source
The category of the SourceMark
, classifies the mark and controls which pixbuf is used and with
which priority it is drawn.
Default value: ""