![]() |
![]() |
![]() |
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
HildonTextView is a text view derived from the GtkTextView widget but with a slightly different appearance designed for the Hildon 2.2 framework.
Text views in Hildon 2.2 can have a placeholder text, set with
hildon_gtk_text_view_set_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
gtk_text_view_get_buffer()
will never return the placeholder text,
not even when it's being displayed.
Example 13. Creating a HildonTextView with a placeholder
GtkWidget * create_text_view (void) { GtkWidget *text_view; text_view = hildon_text_view_new (); hildon_gtk_text_view_set_placeholder_text (GTK_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);
hildon_text_view_set_buffer
is deprecated and should not be used in newly-written code. use gtk_text_view_set_buffer()
instead
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
text_view : |
a HildonTextView |
buffer : |
a GtkTextBuffer |
Since 2.2
GtkTextBuffer* hildon_text_view_get_buffer (HildonTextView *text_view);
hildon_text_view_get_buffer
is deprecated and should not be used in newly-written code. use gtk_text_view_get_buffer()
instead
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 the placeholder text (set using
hildon_gtk_text_view_set_placeholder_text()
) 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);
hildon_text_view_set_placeholder
is deprecated and should not be used in newly-written code. use hildon_gtk_text_view_set_placeholder_text()
instead
Sets the placeholder text in text_view
to text
.
text_view : |
a HildonTextView |
text : |
the new text |
Since 2.2