TextViewRef
public struct TextViewRef : TextViewProtocol, GWeakCapturing
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.
CSS nodes
(plain Language Example):
textview.view
├── border.top
├── border.left
├── text
│ ╰── [selection]
├── border.right
├── border.bottom
╰── [window.popup]
GtkTextView has a main css node with name textview and style class .view, and subnodes for each of the border windows, and the main text area, with names border and text, respectively. The border nodes each get one of the style classes .left, .right, .top or .bottom.
A node representing the selection will appear below the text node.
If a context menu is opened, the window node will appear as a subnode of the main node.
The TextViewRef
type acts as a lightweight Swift reference to an underlying GtkTextView
instance.
It exposes methods that can operate on this data type through TextViewProtocol
conformance.
Use TextViewRef
only as an unowned
reference to an existing GtkTextView
instance.
-
Untyped pointer to the underlying `GtkTextView` instance.
For type-safe access, use the generated, typed pointer
text_view_ptr
property instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GtkTextView>)
-
Designated initialiser from a constant pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GtkTextView>)
-
Conditional initialiser from an optional pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GtkTextView>?)
-
Conditional initialiser from an optional, non-mutable pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GtkTextView>?)
-
Conditional initialiser from an optional
gpointer
Declaration
Swift
@inlinable init!(gpointer g: gpointer?)
-
Conditional initialiser from an optional, non-mutable
gconstpointer
Declaration
Swift
@inlinable init!(gconstpointer g: gconstpointer?)
-
Reference intialiser for a related type that implements
TextViewProtocol
Declaration
Swift
@inlinable init<T>(_ other: T) where T : TextViewProtocol
-
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>
Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> TextViewRef where T : TextViewProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextViewProtocol
.Declaration
Swift
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>)
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextViewProtocol
.Declaration
Swift
@inlinable init<T>(constPointer: UnsafePointer<T>)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextViewProtocol
.Declaration
Swift
@inlinable init(mutating raw: UnsafeRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextViewProtocol
.Declaration
Swift
@inlinable init(raw: UnsafeMutableRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TextViewProtocol
.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer)
-
Creates a new `GtkTextView`. If you don’t call `gtk_text_view_set_buffer()`
before using the text view, an empty default buffer will be created for you. Get the buffer with
gtk_text_view_get_buffer()
. If you want to specify your own buffer, considergtk_text_view_new_with_buffer()
.Declaration
Swift
@inlinable init()
-
Creates a new
GtkTextView
widget displaying the bufferbuffer
. One buffer can be shared among many widgets.buffer
may benil
to create a default buffer, in which case this function is equivalent togtk_text_view_new()
. The text view adds its own reference count to the buffer; it does not take over an existing reference.Declaration
Swift
@inlinable init<TextBufferT>(buffer: TextBufferT) where TextBufferT : TextBufferProtocol
-
Creates a new
GtkTextView
widget displaying the bufferbuffer
. One buffer can be shared among many widgets.buffer
may benil
to create a default buffer, in which case this function is equivalent togtk_text_view_new()
. The text view adds its own reference count to the buffer; it does not take over an existing reference.Declaration
Swift
@inlinable static func newWith<TextBufferT>(buffer: TextBufferT) -> WidgetRef! where TextBufferT : TextBufferProtocol