Portability | portable (depends on GHC) |
---|---|
Stability | provisional |
Maintainer | gtk2hs-users@lists.sourceforge.net |
Safe Haskell | None |
- data SourceGutter
- class GObjectClass o => SourceGutterClass o
- sourceGutterGetWindow :: SourceGutterClass sg => sg -> IO (Maybe DrawWindow)
- sourceGutterInsert :: (CellRendererClass cell, SourceGutterClass sg) => sg -> cell -> Int -> IO ()
- sourceGutterReorder :: (CellRendererClass cell, SourceGutterClass sg) => sg -> cell -> Int -> IO ()
- sourceGutterRemove :: (CellRendererClass cell, SourceGutterClass sg) => sg -> cell -> IO ()
- sourceGutterQueueDraw :: SourceGutterClass sg => sg -> IO ()
- sourceGutterSetCellDataFunc :: (SourceGutterClass sg, CellRendererClass cell) => sg -> cell -> (CellRenderer -> Int -> Bool -> IO ()) -> IO ()
- sourceGutterSetCellSizeFunc :: (SourceGutterClass gutter, CellRendererClass cell) => gutter -> cell -> (CellRenderer -> IO ()) -> IO ()
- sourceGutterView :: SourceGutterClass sg => Attr sg SourceView
- sourceGutterWindowType :: SourceGutterClass sg => Attr sg TextWindowType
- sourceGutterCellActivated :: SourceGutterClass sg => Signal sg (CellRenderer -> TextIter -> EventM EAny ())
- sourceGutterQueryTooltip :: SourceGutterClass sg => Signal sg (CellRenderer -> TextIter -> Tooltip -> IO Bool)
Description
The SourceGutter
object represents the left and right gutters of the text view. It is used by
SourceView
to draw the line numbers and category marks that might be present on a line. By
packing additional CellRenderer
objects in the gutter, you can extend the gutter with your own
custom drawings.
The gutter works very much the same way as cells rendered in a TreeView
. The concept is similar,
with the exception that the gutter does not have an underlying TreeModel
. Instead, you should use
sourceGutterSetCellDataFunc
to set a callback to fill in any of the cell renderers
properties, given the line for which the cell is to be rendered. Renderers are inserted into the
gutter at a certain position.
The builtin line number renderer is at position
'SourceViewGutterPositionLines (-30)' and the marks renderer is at
'SourceViewGutterPositionMarks (-20)'. You can use these values to position custom renderers
accordingly. The width of a cell renderer can be specified as either fixed (using
cellRendererSetFixedSize
) or dynamic, in which case you must set
sourceGutterSetCellSizeFunc
. This callback is used to set the properties of the renderer
such that gtkCellRendererGetSize
yields the maximum width of the cell.
Types
data SourceGutter Source
class GObjectClass o => SourceGutterClass o Source
Methods
sourceGutterGetWindow :: SourceGutterClass sg => sg -> IO (Maybe DrawWindow)Source
Get the Window
of the gutter. The window will only be available when the gutter has at least one,
non-zero width, cell renderer packed.
:: (CellRendererClass cell, SourceGutterClass sg) | |
=> sg | |
-> cell |
|
-> Int |
|
-> IO () |
Inserts renderer into gutter at position.
:: (CellRendererClass cell, SourceGutterClass sg) | |
=> sg | |
-> cell |
|
-> Int |
|
-> IO () |
Reorders renderer in gutter to new position.
:: (CellRendererClass cell, SourceGutterClass sg) | |
=> sg | |
-> cell |
|
-> IO () |
Removes renderer from gutter.
sourceGutterQueueDraw :: SourceGutterClass sg => sg -> IO ()Source
Invalidates the drawable area of the gutter. You can use this to force a redraw of the gutter if something has changed and needs to be redrawn.
sourceGutterSetCellDataFunc :: (SourceGutterClass sg, CellRendererClass cell) => sg -> cell -> (CellRenderer -> Int -> Bool -> IO ()) -> IO ()Source
Sets the SourceGutterDataFunc
to use for renderer. This function is used to setup the cell
renderer properties for rendering the current cell.
sourceGutterSetCellSizeFunc :: (SourceGutterClass gutter, CellRendererClass cell) => gutter -> cell -> (CellRenderer -> IO ()) -> IO ()Source
Sets the SourceGutterSizeFunc
to use for renderer. This function is used to setup the cell
renderer properties for measuring the maximum size of the cell.
Attributes
sourceGutterView :: SourceGutterClass sg => Attr sg SourceViewSource
The SourceView
of the gutter
sourceGutterWindowType :: SourceGutterClass sg => Attr sg TextWindowTypeSource
The text window type on which the window is placed
Default value: TextWindowPrivate
Signals
sourceGutterCellActivated :: SourceGutterClass sg => Signal sg (CellRenderer -> TextIter -> EventM EAny ())Source
Emitted when a cell has been activated (for instance when there was a button press on the cell). The
signal is only emitted for cells that have the activatable property set to True
.
sourceGutterQueryTooltip :: SourceGutterClass sg => Signal sg (CellRenderer -> TextIter -> Tooltip -> IO Bool)Source
Emitted when a tooltip is requested for a specific cell. Signal handlers can return True
to notify
the tooltip has been handled.