[gtk+/gtk-2-90: 111/127] Remove deprecated GtkEntry stuff from docs and tutorial.
- From: Javier Jardón <jjardon src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-90: 111/127] Remove deprecated GtkEntry stuff from docs and tutorial.
- Date: Tue, 17 Nov 2009 19:34:07 +0000 (UTC)
commit a838454dc11338347ef04565c8c478ab9912ef4b
Author: Javier Jardón <jjardon gnome org>
Date: Thu Oct 22 05:59:05 2009 +0200
Remove deprecated GtkEntry stuff from docs and tutorial.
Also, substitue the deprecated functions with the new ones in
documentation and in tests code
docs/faq/gtk-faq.sgml | 8 ++--
docs/reference/gtk/gtk-sections.txt | 6 ----
docs/reference/gtk/tmpl/gtkentry.sgml | 54 ---------------------------------
docs/tutorial/gtk_tut.sgml | 49 +++++++++++++++--------------
modules/other/gail/tests/ferret.c | 2 +-
5 files changed, 30 insertions(+), 89 deletions(-)
---
diff --git a/docs/faq/gtk-faq.sgml b/docs/faq/gtk-faq.sgml
index 01c71d3..508d231 100644
--- a/docs/faq/gtk-faq.sgml
+++ b/docs/faq/gtk-faq.sgml
@@ -2527,15 +2527,15 @@ using the following expression:</para>
<para>If you don't want the user to be able to modify the
content of this entry, you can use the
-gtk_entry_set_editable() function:</para>
+gtk_editable_set_editable() function:</para>
<programlisting role="C">
- void gtk_entry_set_editable(GtkEntry *entry,
- gboolean editable);
+void gtk_editable_set_editable (GtkEditable *editable,
+ gboolean is_editable);
</programlisting>
-<para>Set the editable parameter to FALSE to disable typing
+<para>Set the is_editable parameter to FALSE to disable typing
into the entry.</para>
</sect1>
diff --git a/docs/reference/gtk/gtk-sections.txt b/docs/reference/gtk/gtk-sections.txt
index 3c12977..c209940 100644
--- a/docs/reference/gtk/gtk-sections.txt
+++ b/docs/reference/gtk/gtk-sections.txt
@@ -1254,20 +1254,14 @@ gtk_old_editable_get_type
GtkEntry
gtk_entry_new
gtk_entry_new_with_buffer
-gtk_entry_new_with_max_length
gtk_entry_get_buffer
gtk_entry_set_buffer
gtk_entry_set_text
-gtk_entry_append_text
-gtk_entry_prepend_text
-gtk_entry_set_position
gtk_entry_get_text
gtk_entry_get_text_length
-gtk_entry_select_region
gtk_entry_set_visibility
gtk_entry_set_invisible_char
gtk_entry_unset_invisible_char
-gtk_entry_set_editable
gtk_entry_set_max_length
gtk_entry_get_activates_default
gtk_entry_get_has_frame
diff --git a/docs/reference/gtk/tmpl/gtkentry.sgml b/docs/reference/gtk/tmpl/gtkentry.sgml
index 59a95c6..181eba1 100644
--- a/docs/reference/gtk/tmpl/gtkentry.sgml
+++ b/docs/reference/gtk/tmpl/gtkentry.sgml
@@ -415,14 +415,6 @@ The #GtkEntry-struct struct contains only private data.
@Returns:
-<!-- ##### FUNCTION gtk_entry_new_with_max_length ##### -->
-<para>
-</para>
-
- max:
- Returns:
-
-
<!-- ##### FUNCTION gtk_entry_get_buffer ##### -->
<para>
@@ -450,33 +442,6 @@ The #GtkEntry-struct struct contains only private data.
@text:
-<!-- ##### FUNCTION gtk_entry_append_text ##### -->
-<para>
-
-</para>
-
- entry:
- text:
-
-
-<!-- ##### FUNCTION gtk_entry_prepend_text ##### -->
-<para>
-
-</para>
-
- entry:
- text:
-
-
-<!-- ##### FUNCTION gtk_entry_set_position ##### -->
-<para>
-
-</para>
-
- entry:
- position:
-
-
<!-- ##### FUNCTION gtk_entry_get_text ##### -->
<para>
@@ -495,16 +460,6 @@ The #GtkEntry-struct struct contains only private data.
@Returns:
-<!-- ##### FUNCTION gtk_entry_select_region ##### -->
-<para>
-
-</para>
-
- entry:
- start:
- end:
-
-
<!-- ##### FUNCTION gtk_entry_set_visibility ##### -->
<para>
@@ -531,15 +486,6 @@ The #GtkEntry-struct struct contains only private data.
@entry:
-<!-- ##### FUNCTION gtk_entry_set_editable ##### -->
-<para>
-
-</para>
-
- entry:
- editable:
-
-
<!-- ##### FUNCTION gtk_entry_set_max_length ##### -->
<para>
</para>
diff --git a/docs/tutorial/gtk_tut.sgml b/docs/tutorial/gtk_tut.sgml
index a814c41..92aa241 100644
--- a/docs/tutorial/gtk_tut.sgml
+++ b/docs/tutorial/gtk_tut.sgml
@@ -4772,11 +4772,11 @@ There are two functions for creating Entry widgets:
<tscreen><verb>
GtkWidget *gtk_entry_new( void );
-GtkWidget *gtk_entry_new_with_max_length( guint16 max );
+GtkWidget *gtk_entry_new_with_buffer( GtkEntryBuffer *buffer );
</verb></tscreen>
The first just creates a new Entry widget, whilst the second creates a
-new Entry and sets a limit on the length of the text within the Entry.
+new Entry with the specified text buffer.
There are several functions for altering the text which is currently
within the Entry widget.
@@ -4785,23 +4785,21 @@ within the Entry widget.
void gtk_entry_set_text( GtkEntry *entry,
const gchar *text );
-void gtk_entry_append_text( GtkEntry *entry,
- const gchar *text );
-
-void gtk_entry_prepend_text( GtkEntry *entry,
- const gchar *text );
+void gtk_editable_insert_text( GtkEditable *editable,
+ const gchar *new_text,
+ gint new_text_length,
+ gint *position);
</verb></tscreen>
The function gtk_entry_set_text sets the contents of the Entry widget,
-replacing the current contents. The functions gtk_entry_append_text
-and gtk_entry_prepend_text allow the current contents to be appended
-and prepended to.
+replacing the current contents. The function gtk_editable_insert_text
+allow the current contents to be appended or prepended to.
The next function allows the current insertion point to be set.
<tscreen><verb>
-void gtk_entry_set_position( GtkEntry *entry,
- gint position );
+void gtk_editable_set_position( GtkEditable *editable,
+ gint position);
</verb></tscreen>
The contents of the Entry can be retrieved by using a call to the
@@ -4818,12 +4816,12 @@ If we don't want the contents of the Entry to be changed by someone typing
into it, we can change its editable state.
<tscreen><verb>
-void gtk_entry_set_editable( GtkEntry *entry,
- gboolean editable );
+void gtk_editable_set_editable( GtkEditable *editable,
+ gboolean is_editable);
</verb></tscreen>
The function above allows us to toggle the editable state of the
-Entry widget by passing in a TRUE or FALSE value for the <tt/editable/
+Entry widget by passing in a TRUE or FALSE value for the <tt/is_editable/
argument.
If we are using the Entry where we don't want the text entered to be
@@ -4840,9 +4838,9 @@ function. This would most often be used after setting some default
text in an Entry, making it easy for the user to remove it.
<tscreen><verb>
-void gtk_entry_select_region( GtkEntry *entry,
- gint start,
- gint end );
+void gtk_editable_select_region (GtkEditable *editable,
+ gint start_pos,
+ gint end_pos);
</verb></tscreen>
If we want to catch when the user has entered text, we can connect to
@@ -4870,8 +4868,8 @@ void enter_callback( GtkWidget *widget,
void entry_toggle_editable( GtkWidget *checkbutton,
GtkWidget *entry )
{
- gtk_entry_set_editable(GTK_ENTRY(entry),
- GTK_TOGGLE_BUTTON(checkbutton)->active);
+ gtk_editable_set_editable(GTK_EDITABLE (entry),
+ GTK_TOGGLE_BUTTON(checkbutton)->active);
}
void entry_toggle_visibility( GtkWidget *checkbutton,
@@ -4890,6 +4888,7 @@ int main( int argc,
GtkWidget *entry;
GtkWidget *button;
GtkWidget *check;
+ gint tmp_pos;
gtk_init (&argc, &argv);
@@ -4904,14 +4903,16 @@ int main( int argc,
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_widget_show (vbox);
- entry = gtk_entry_new_with_max_length (50);
+ entry = gtk_entry_new ();
+ gtk_entry_buffer_set_max_length (gtk_entry_get_buffer (entry), 50);
gtk_signal_connect(GTK_OBJECT(entry), "activate",
GTK_SIGNAL_FUNC(enter_callback),
entry);
gtk_entry_set_text (GTK_ENTRY (entry), "hello");
- gtk_entry_append_text (GTK_ENTRY (entry), " world");
- gtk_entry_select_region (GTK_ENTRY (entry),
- 0, GTK_ENTRY(entry)->text_length);
+ tmp_pos = GTK_ENTRY (entry)->text_length;
+ gtk_editable_insert_text (GTK_EDITABLE (entry), " world", -1, &tmp_pos);
+ gtk_editable_select_region (GTK_EDITABLE (entry),
+ 0, GTK_ENTRY (entry)->text_length);
gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0);
gtk_widget_show (entry);
diff --git a/modules/other/gail/tests/ferret.c b/modules/other/gail/tests/ferret.c
index 02d106f..f6de779 100644
--- a/modules/other/gail/tests/ferret.c
+++ b/modules/other/gail/tests/ferret.c
@@ -1977,7 +1977,7 @@ _get_name_value(GroupInfo *group, const gchar *label,
name_value->label = GTK_LABEL(gtk_label_new(label));
name_value->string = gtk_label_new (NULL);
name_value->boolean = gtk_check_button_new ();
- name_value->text = gtk_entry_new_with_max_length (1000);
+ gtk_entry_buffer_set_max_length (gtk_entry_get_buffer (name_value->text), 1000);
name_value->button = GTK_BUTTON(gtk_button_new ());
gtk_box_pack_end(GTK_BOX(name_value->column1),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]