| Hildon Reference Manual | ||||
|---|---|---|---|---|
HildonTextView;
GtkWidget* hildon_text_view_new (void);
void hildon_text_view_set_buffer (HildonTextView *text_view,
GtkTextBuffer *buffer);
GtkTextBuffer* hildon_text_view_get_buffer (HildonTextView *text_view);
void hildon_text_view_set_placeholder (HildonTextView *text_view,
const gchar *text);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkTextView +----HildonTextView
The HildonTextView is a text view derived from the GtkTextView widget that provides additional commodities specific to the Hildon framework.
Besides all the features inherited from GtkTextView, a
HildonTextView can also have a placeholder text. This text will be
shown if the text view is empty and doesn't have the input focus,
but it's otherwise ignored. Thus, calls to
hildon_text_view_get_buffer() will never return the placeholder
text, not even when it's being displayed.
Although HildonTextView is derived from GtkTextView,
gtk_text_view_get_buffer() and gtk_text_view_set_buffer() must
never be used to get/set the buffer in this
widget. hildon_text_view_get_buffer() and
hildon_text_view_set_buffer() must be used instead.
Example 13. Creating a HildonTextView with a placeholder
GtkWidget *
create_text_view (void)
{
GtkWidget *text_view;
text_view = hildon_text_view_new ();
hildon_text_view_set_placeholder (HILDON_TEXT_VIEW (text_view),
"Type some text here");
return text_view;
}
GtkWidget* hildon_text_view_new (void);
Creates a new text view.
| Returns : | a new HildonTextView |
Since 2.2
void hildon_text_view_set_buffer (HildonTextView *text_view, GtkTextBuffer *buffer);
Sets buffer as the buffer being displayed by text_view. The
previous buffer displayed by the text view is unreferenced, and a
reference is added to buffer. If you owned a reference to buffer
before passing it to this function, you must remove that reference
yourself
Note that you must never use gtk_text_view_set_buffer() to set the
buffer of a HildonTextView.
text_view : |
a HildonTextView |
buffer : |
a GtkTextBuffer |
Since 2.2
GtkTextBuffer* hildon_text_view_get_buffer (HildonTextView *text_view);
Returns the text buffer in text_view. The reference count is not
incremented; the caller of this function won't own a new reference.
Note that you must never use gtk_text_view_get_buffer() to get the
buffer from a HildonTextView.
Also note that placeholder text (set using
hildon_text_view_set_placeholder()) is never contained in this
buffer.
text_view : |
a HildonTextView |
| Returns : | a GtkTextBuffer |
Since 2.2
void hildon_text_view_set_placeholder (HildonTextView *text_view, const gchar *text);
Sets the placeholder text in text_view to text.
text_view : |
a HildonTextView |
text : |
the new text |
Since 2.2