Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The collection of tags in a GtkTextBuffer
You may wish to begin by reading the text widget conceptual overview, which gives an overview of all the objects and data types related to the text widget and how they work together.
GtkTextTagTables as GtkBuildable
The GtkTextTagTable
implementation of the GtkBuildable
interface
supports adding tags by specifying “tag” as the “type” attribute
of a <child>
element.
An example of a UI definition fragment specifying tags:
xml code
<object class="GtkTextTagTable"> <child type="tag"> <object class="GtkTextTag"/> </child> </object>
Synopsis
- newtype TextTagTable = TextTagTable (ManagedPtr TextTagTable)
- class (GObject o, IsDescendantOf TextTagTable o) => IsTextTagTable o
- toTextTagTable :: (MonadIO m, IsTextTagTable o) => o -> m TextTagTable
- textTagTableAdd :: (HasCallStack, MonadIO m, IsTextTagTable a, IsTextTag b) => a -> b -> m Bool
- textTagTableForeach :: (HasCallStack, MonadIO m, IsTextTagTable a) => a -> TextTagTableForeach -> m ()
- textTagTableGetSize :: (HasCallStack, MonadIO m, IsTextTagTable a) => a -> m Int32
- textTagTableLookup :: (HasCallStack, MonadIO m, IsTextTagTable a) => a -> Text -> m (Maybe TextTag)
- textTagTableNew :: (HasCallStack, MonadIO m) => m TextTagTable
- textTagTableRemove :: (HasCallStack, MonadIO m, IsTextTagTable a, IsTextTag b) => a -> b -> m ()
- type TextTagTableTagAddedCallback = TextTag -> IO ()
- afterTextTagTableTagAdded :: (IsTextTagTable a, MonadIO m) => a -> ((?self :: a) => TextTagTableTagAddedCallback) -> m SignalHandlerId
- onTextTagTableTagAdded :: (IsTextTagTable a, MonadIO m) => a -> ((?self :: a) => TextTagTableTagAddedCallback) -> m SignalHandlerId
- type TextTagTableTagChangedCallback = TextTag -> Bool -> IO ()
- afterTextTagTableTagChanged :: (IsTextTagTable a, MonadIO m) => a -> ((?self :: a) => TextTagTableTagChangedCallback) -> m SignalHandlerId
- onTextTagTableTagChanged :: (IsTextTagTable a, MonadIO m) => a -> ((?self :: a) => TextTagTableTagChangedCallback) -> m SignalHandlerId
- type TextTagTableTagRemovedCallback = TextTag -> IO ()
- afterTextTagTableTagRemoved :: (IsTextTagTable a, MonadIO m) => a -> ((?self :: a) => TextTagTableTagRemovedCallback) -> m SignalHandlerId
- onTextTagTableTagRemoved :: (IsTextTagTable a, MonadIO m) => a -> ((?self :: a) => TextTagTableTagRemovedCallback) -> m SignalHandlerId
Exported types
newtype TextTagTable Source #
Memory-managed wrapper type.
TextTagTable (ManagedPtr TextTagTable) |
Instances
Eq TextTagTable Source # | |
Defined in GI.Gtk.Objects.TextTagTable (==) :: TextTagTable -> TextTagTable -> Bool # (/=) :: TextTagTable -> TextTagTable -> Bool # | |
GObject TextTagTable Source # | |
Defined in GI.Gtk.Objects.TextTagTable | |
ManagedPtrNewtype TextTagTable Source # | |
Defined in GI.Gtk.Objects.TextTagTable toManagedPtr :: TextTagTable -> ManagedPtr TextTagTable | |
TypedObject TextTagTable Source # | |
Defined in GI.Gtk.Objects.TextTagTable | |
HasParentTypes TextTagTable Source # | |
Defined in GI.Gtk.Objects.TextTagTable | |
IsGValue (Maybe TextTagTable) Source # | Convert |
Defined in GI.Gtk.Objects.TextTagTable gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe TextTagTable -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe TextTagTable) | |
type ParentTypes TextTagTable Source # | |
Defined in GI.Gtk.Objects.TextTagTable |
class (GObject o, IsDescendantOf TextTagTable o) => IsTextTagTable o Source #
Type class for types which can be safely cast to TextTagTable
, for instance with toTextTagTable
.
Instances
(GObject o, IsDescendantOf TextTagTable o) => IsTextTagTable o Source # | |
Defined in GI.Gtk.Objects.TextTagTable |
toTextTagTable :: (MonadIO m, IsTextTagTable o) => o -> m TextTagTable Source #
Cast to TextTagTable
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
add, bindProperty, bindPropertyFull, forceFloating, foreach, freezeNotify, getv, isFloating, lookup, notify, notifyByPspec, ref, refSink, remove, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getBuildableId, getData, getProperty, getQdata, getSize.
Setters
add
:: (HasCallStack, MonadIO m, IsTextTagTable a, IsTextTag b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Add a tag to the table.
The tag is assigned the highest priority in the table.
tag
must not be in a tag table already, and may not have
the same name as an already-added tag.
foreach
:: (HasCallStack, MonadIO m, IsTextTagTable a) | |
=> a |
|
-> TextTagTableForeach |
|
-> m () |
Calls func
on each tag in table
, with user data data
.
Note that the table may not be modified while iterating over it (you can’t add/remove tags).
getSize
:: (HasCallStack, MonadIO m, IsTextTagTable a) | |
=> a |
|
-> m Int32 | Returns: number of tags in |
Returns the size of the table (number of tags)
lookup
:: (HasCallStack, MonadIO m, IsTextTagTable a) | |
=> a |
|
-> Text |
|
-> m (Maybe TextTag) | Returns: The tag |
Look up a named tag.
new
:: (HasCallStack, MonadIO m) | |
=> m TextTagTable | Returns: a new |
Creates a new GtkTextTagTable
.
The table contains no tags by default.
remove
:: (HasCallStack, MonadIO m, IsTextTagTable a, IsTextTag b) | |
=> a |
|
-> b |
|
-> m () |
Remove a tag from the table.
If a GtkTextBuffer
has table
as its tag table, the tag is
removed from the buffer. The table’s reference to the tag is
removed, so the tag will end up destroyed if you don’t have
a reference to it.
Signals
tagAdded
type TextTagTableTagAddedCallback Source #
Emitted every time a new tag is added in the GtkTextTagTable
.
afterTextTagTableTagAdded :: (IsTextTagTable a, MonadIO m) => a -> ((?self :: a) => TextTagTableTagAddedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the tagAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
textTagTable #tagAdded callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onTextTagTableTagAdded :: (IsTextTagTable a, MonadIO m) => a -> ((?self :: a) => TextTagTableTagAddedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the tagAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
textTagTable #tagAdded callback
tagChanged
type TextTagTableTagChangedCallback Source #
= TextTag |
|
-> Bool |
|
-> IO () |
Emitted every time a tag in the GtkTextTagTable
changes.
afterTextTagTableTagChanged :: (IsTextTagTable a, MonadIO m) => a -> ((?self :: a) => TextTagTableTagChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the tagChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
textTagTable #tagChanged callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onTextTagTableTagChanged :: (IsTextTagTable a, MonadIO m) => a -> ((?self :: a) => TextTagTableTagChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the tagChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
textTagTable #tagChanged callback
tagRemoved
type TextTagTableTagRemovedCallback Source #
Emitted every time a tag is removed from the GtkTextTagTable
.
The tag
is still valid by the time the signal is emitted, but
it is not associated with a tag table any more.
afterTextTagTableTagRemoved :: (IsTextTagTable a, MonadIO m) => a -> ((?self :: a) => TextTagTableTagRemovedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the tagRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
textTagTable #tagRemoved callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onTextTagTableTagRemoved :: (IsTextTagTable a, MonadIO m) => a -> ((?self :: a) => TextTagTableTagRemovedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the tagRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
textTagTable #tagRemoved callback