Package ch.bailu.gtk.gtk
Class TextTagTable
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.TextTagTable
- All Implemented Interfaces:
PointerInterface
The collection of tags in a `GtkTextBuffer`
You may wish to begin by reading the
[text widget conceptual overview](section-text-widget.html),
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
<object class="GtkTextTagTable">
<child type="tag">
<object class="GtkTextTag"/>
</child>
</object>
```
You may wish to begin by reading the
[text widget conceptual overview](section-text-widget.html),
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
<object class="GtkTextTagTable">
<child type="tag">
<object class="GtkTextTag"/>
</child>
</object>
```
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Add a tag to the table.Implements interfaceBuildable
.void
foreach
(TextTagTable.OnTextTagTableForeach func, Pointer data) Calls @func on each tag in @table, with user data @data.static ClassHandler
static int
static long
static TypeSystem.TypeSize
int
getSize()
Returns the size of the table (number of tags)static long
static TypeSystem.TypeSize
Look up a named tag.Look up a named tag.onTagAdded
(TextTagTable.OnTagAdded signal) Connect to signal "tag-added".Connect to signal "tag-changed".Connect to signal "tag-removed".void
Remove a tag from the table.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_TAG_ADDED
- See Also:
-
SIGNAL_ON_TAG_CHANGED
- See Also:
-
SIGNAL_ON_TAG_REMOVED
- See Also:
-
-
Constructor Details
-
TextTagTable
-
TextTagTable
public TextTagTable()Creates a new `GtkTextTagTable`.
The table contains no tags by default.
-
-
Method Details
-
getClassHandler
-
add
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.- Parameters:
tag
- a `GtkTextTag`- Returns:
- %TRUE on success.
-
foreach
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).- Parameters:
func
- a function to call on each tagdata
- user data
-
getSize
public int getSize()Returns the size of the table (number of tags)- Returns:
- number of tags in @table
-
lookup
Look up a named tag.- Parameters:
name
- name of a tag- Returns:
- The tag
-
lookup
Look up a named tag.- Parameters:
name
- name of a tag- Returns:
- The tag
-
remove
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.- Parameters:
tag
- a `GtkTextTag`
-
onTagAdded
Connect to signal "tag-added".
SeeTextTagTable.OnTagAdded.onTagAdded(ch.bailu.gtk.gtk.TextTag)
for signal description.
FieldSIGNAL_ON_TAG_ADDED
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onTagChanged
Connect to signal "tag-changed".
SeeTextTagTable.OnTagChanged.onTagChanged(ch.bailu.gtk.gtk.TextTag, boolean)
for signal description.
FieldSIGNAL_ON_TAG_CHANGED
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onTagRemoved
Connect to signal "tag-removed".
SeeTextTagTable.OnTagRemoved.onTagRemoved(ch.bailu.gtk.gtk.TextTag)
for signal description.
FieldSIGNAL_ON_TAG_REMOVED
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
asBuildable
Implements interfaceBuildable
. Call this to get access to interface functions.- Returns:
Buildable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-