Next: Events, Previous: Clutter Effects, Up: Top
A single line text entry actor
<clutter-entry> is a <clutter-texture> that allows single line
text entry.
<clutter-entry> is available since Clutter 0.4.
Derives from
<clutter-actor>.This class defines the following slots:
font-name- Pango font description
text- Text to render
color- Font Colour
alignment- The preferred alignment for the string,
position- The cursor position
cursor-visible- Whether the input cursor is visible
text-visible- Whether the text is visible in plain form
max-length- The maximum length of the entry text
entry-padding- The padding space between the text and the left and right borders
x-align- The horizontal alignment to be used for the text
The ::activate signal is emitted each time the entry is 'activated' by the user, normally by pressing the 'Enter' key.
Since 0.4
The ::text-changed signal is emitted after entry's text changes
<clutter-geometry>)The ::cursor-event signal is emitted each time the input cursor's geometry changes, this could be a positional or size change. If you would like to implement your own input cursor, set the cursor-visible property to ‘
#f’, and connect to this signal to position and size your own cursor.Since 0.4
<clutter-actor>)Creates a new, empty
<clutter-entry>.
- ret
- the newly created
<clutter-entry>
mchars) (text mchars) (ret <clutter-actor>)Creates a new
<clutter-entry>displaying text using font-name.
- font-name
- the name (and size) of the font to be used
- text
- the text to be displayed
- ret
- the newly created
<clutter-entry>Since 0.4
mchars) (text mchars) (color <clutter-color>) (ret <clutter-actor>)Creates a new
<clutter-entry>displaying text with color using font-name.
- font-name
- the name (and size) of the font to be used
- text
- the text to be displayed
- color
<clutter-color>for text- ret
- the newly created
<clutter-entry>Since 0.4
<clutter-entry>) (text mchars)Sets text as the text to be displayed by entry. The ClutterEntry::text-changed signal is emitted.
- entry
- a
<clutter-entry>- text
- the text to be displayed
Since 0.4
<clutter-entry>) (ret mchars)Retrieves the text displayed by entry.
- entry
- a
<clutter-entry>- ret
- the text of the entry. The returned string is owned by
<clutter-entry>and should not be modified or freed.Since 0.4
<clutter-entry>) (font_name mchars)Sets font-name as the font used by entry.
font-name must be a string containing the font name and its size, similarly to what you would feed to the
pango-font-description-from-stringfunction.
- entry
- a
<clutter-entry>- font-name
- a font name and size, or ‘
#f’ for the default fontSince 0.4
<clutter-entry>) (ret mchars)Retrieves the font used by entry.
- entry
- a
<clutter-entry>- ret
- a string containing the font name, in a format understandable by
pango-font-description-from-string. The string is owned by<clutter-entry>and should not be modified or freed.Since 0.4
<clutter-entry>) (color <clutter-color>)Sets the color of entry.
- entry
- a
<clutter-entry>- color
- a
<clutter-color>Since 0.4
<clutter-entry>) (color <clutter-color>)Retrieves the color of entry.
- entry
- a
<clutter-entry>- color
- return location for a
<clutter-color>Since 0.4
<clutter-entry>) (ret <pango-layout>)Gets the
<pango-layout>used to display the entry. The layout is useful to e.g. convert text positions to pixel positions. The returned layout is owned by the entry so need not be freed by the caller.
- entry
- a
<clutter-entry>- ret
- the
<pango-layout>for this entrySince 0.4
<clutter-entry>) (alignment <pango-alignment>)Sets text alignment of the entry.
- entry
- a
<clutter-entry>- alignment
- A
<pango-alignment>Since 0.4
<clutter-entry>) (ret <pango-alignment>)Returns the entry's text alignment
- entry
- a
<clutter-entry>- ret
- The entry's
<pango-alignment>Since 0.4
<clutter-entry>) (position int)Sets the position of the cursor. The position must be less than or equal to the number of characters in the entry. A value of -1 indicates that the position should be set after the last character in the entry. Note that this position is in characters, not in bytes.
- entry
- a
<clutter-entry>- position
- the position of the cursor.
Since 0.6
<clutter-entry>) (ret int)Gets the position, in characters, of the cursor in entry.
- entry
- a
<clutter-entry>- ret
- the position of the cursor.
Since 0.6
<clutter-entry>) (kev <clutter-key-event>)‘clutter_entry_handle_key_event’ has been deprecated since version 0.8 and should not be used in newly-written code. The key events will automatically be handled when giving the key focus to an entry using
clutter-stage-set-key-focus.This function will handle a
<clutter-key-event>, like those returned in a key-press/release-event, and will translate it for the entry. This includes non-alphanumeric keys, such as the arrows keys, which will move the input cursor. You should use this function inside a handler for the ClutterStage::key-press-event or ClutterStage::key-release-event.
- entry
- a
<clutter-entry>- kev
- a
<clutter-key-event>Since 0.4
<clutter-entry>) (wc unsigned-int32)Insert a character to the right of the current position of the cursor, and updates the position of the cursor.
- entry
- a
<clutter-entry>- wc
- a Unicode character
Since 0.4
<clutter-entry>) (len unsigned-int)Characters are removed from before the current postion of the cursor.
- entry
- a
<clutter-entry>- len
- the number of characters to remove.
Since 0.4
<clutter-entry>) (text mchars) (position ssize_t)Insert text at a specifc position.
A value of 0 indicates that the text will be inserted before the first character in the entry's text, and a value of -1 indicates that the text will be inserted after the last character in the entry's text.
- entry
- a
<clutter-entry>- text
- the text to insert
- position
- the position at which to insert the text.
Since 0.4
<clutter-entry>) (start_pos ssize_t) (end_pos ssize_t)Deletes a sequence of characters. The characters that are deleted are those characters at positions from start-pos up to, but not including, end-pos. If end-pos is negative, then the characters deleted will be those characters from start-pos to the end of the text.
- entry
- a
<clutter-entry>- start-pos
- the starting position.
- end-pos
- the end position.
Since 0.4
<clutter-entry>) (visible bool)Sets the visibility of the input cursor.
- entry
- a
<clutter-entry>- visible
- whether the input cursor should be visible
Since 0.4
<clutter-entry>) (ret bool)Returns the input cursor's visibility
- entry
- a
<clutter-entry>- ret
- whether the input cursor is visible
Since 0.4
<clutter-entry>) (visible bool)Sets whether the contents of the entry are visible or not. When visibility is set to ‘
#f’, characters are displayed as the invisible char, and will also appear that way when the text in the entry widget is copied elsewhere.The default invisible char is the asterisk '*', but it can be changed with
clutter-entry-set-invisible-char.
- entry
- a
<clutter-entry>- visible
- ‘
#t’ if the contents of the entry are displayed as plaintext.Since 0.4
<clutter-entry>) (ret bool)Returns the entry text visibility.
- entry
- a
<clutter-entry>- ret
- ‘
#t’ if the contents of the entry are displayed as plaintext.Since 0.4
<clutter-entry>) (wc unsigned-int32)Sets the character to use in place of the actual text when
clutter-entry-set-visibilityhas been called to set text visibility to ‘#f’. i.e. this is the character used in "password mode" to show the user how many characters have been typed. The default invisible char is an asterisk ('*'). If you set the invisible char to 0, then the user will get no feedback at all; there will be no text on the screen as they type.
- entry
- a
<clutter-entry>- wc
- a Unicode character
Since 0.4
<clutter-entry>) (ret unsigned-int32)Returns the character to use in place of the actual text when text-visibility is set to ‘
#f’
- entry
- a
<clutter-entry>- ret
- a Unicode character
<clutter-entry>) (max int)Sets the maximum allowed length of the contents of the actor. If the current contents are longer than the given length, then they will be truncated to fit.
- entry
- a
<clutter-entry>- max
- the maximum number of characters allowed in the entry; 0 to disable or -1 to set the length of the current string
Since 0.4