Texts » History » Revision 8
« Previous |
Revision 8/31
(diff)
| Next »
iri, 03/19/2011 01:52 PM
Texts¶
Widget that displays a text string, typically on multi lines.
A text object can be seen as a container. Each text object has a buffer object. The buffer object stores the content (the string). You can change buffer object to a same text object.
_gtkTextView¶
Create a new text object.
Prototype : fun [Chn ObjGtkWidget S] [ObjGtkWidgetObjGtkWidget]
channel | Chn | a channel. Can not be nil |
buffer | ObjGtkWidget | a text buffer object. It can be nil; in this case, a default buffer will be created |
content | S | an initial content. It can be nil |
Return : [ObjGtkWidget ObjGtkWidget] : the new text object and the buffer text object. If buffer was not nil, this will be the same, otherwise, it will be a new buffer text object too.
_gtkTextGetBuffer¶
Return the current buffer object.
Prototype : fun [ObjGtkWidget] ObjGtkWidget
Text object -> buffer object.
_gtkTextGetEditable¶
Return if a text object is editable or not.
Prototype : fun [ObjGtkWidget] I
Return : I : 1 if editable, else 0. Nil if error (object is nil).
_gtkTextSetEditable¶
Set if a text object is editable or not.
Prototype : fun [ObjGtkWidget I] ObjGtkWidget
Set the integer to 1 if the text must be editable, 0 otherwise
Return : ObjGtkWidget : the same text object or nil if error (object is nil).
Buffers¶
_gtkTextBufferNew¶
Create a new text buffer object.
Prototype : fun [Chn ObjGtkWidget] ObjGtkWidget
channel | Chn | A channel |
tagstable | ObjGtkWidget | A tags table object or nil (in this case, a default table object will be created) |
Return : ObjGtkWidget : a new text buffer object or nil if error
_gtkTextBufferInsert¶
Insert a string in a position
Prototype : fun [ObjGtkWidget S I] ObjGtkWidget
buffer | ObjGtkWidget | Any buffer already created |
string | S | Any string to insert |
position | I | A position. If nil, negative or greater than the current length of the buffer, the position will be the end |
Return : ObjGtkWidget : the same text buffer object or nil if error.
_gtkTextBufferCount¶
Gets the number of lines and of characters in the buffer. The number of characters and the numbers of bytes can be different. here, the number of characters is returned.
Prototype : fun [ObjGtkWidget] [I I]
Return : [I I] : a tuple with the number of lines and the numbers of characters. If error, the function returns nil.
Return Api
Updated by iri over 13 years ago · 8 revisions