entry, spin button: Drop redundant API

Avoid duplicating GtkEditable APIs. Port existing users.
This commit is contained in:
Matthias Clasen 2019-02-28 14:31:36 -05:00
parent dc282991c6
commit 9e0c471b03
59 changed files with 185 additions and 472 deletions

View File

@ -80,7 +80,7 @@ on_entry_changed (GtkWidget *widget, gpointer data)
page_number = gtk_assistant_get_current_page (assistant);
current_page = gtk_assistant_get_nth_page (assistant, page_number);
text = gtk_entry_get_text (GTK_ENTRY (widget));
text = gtk_editable_get_text (GTK_EDITABLE (widget));
if (text && *text)
gtk_assistant_set_page_complete (assistant, current_page, TRUE);

View File

@ -28,7 +28,7 @@ copy_button_clicked (GtkWidget *button,
clipboard = gtk_widget_get_clipboard (entry);
/* Set clipboard text */
gdk_clipboard_set_text (clipboard, gtk_entry_get_text (GTK_ENTRY (entry)));
gdk_clipboard_set_text (clipboard, gtk_editable_get_text (GTK_EDITABLE (entry)));
}
void
@ -50,7 +50,7 @@ paste_received (GObject *source_object,
if (text)
{
/* Set the entry text */
gtk_entry_set_text (GTK_ENTRY (entry), text);
gtk_editable_set_text (GTK_EDITABLE (entry), text);
g_free (text);
}
else

View File

@ -256,7 +256,7 @@ mask_entry_set_background (MaskEntry *entry)
{
if (entry->mask)
{
if (!g_regex_match_simple (entry->mask, gtk_entry_get_text (GTK_ENTRY (entry)), 0, 0))
if (!g_regex_match_simple (entry->mask, gtk_editable_get_text (GTK_EDITABLE (entry)), 0, 0))
{
PangoAttrList *attrs;

View File

@ -69,7 +69,7 @@ interactive_dialog_clicked (GtkButton *button,
label = gtk_label_new_with_mnemonic ("_Entry 1");
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
local_entry1 = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (local_entry1), gtk_entry_get_text (GTK_ENTRY (entry1)));
gtk_editable_set_text (GTK_EDITABLE (local_entry1), gtk_editable_get_text (GTK_EDITABLE (entry1)));
gtk_grid_attach (GTK_GRID (table), local_entry1, 1, 0, 1, 1);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), local_entry1);
@ -77,7 +77,7 @@ interactive_dialog_clicked (GtkButton *button,
gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1);
local_entry2 = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (local_entry2), gtk_entry_get_text (GTK_ENTRY (entry2)));
gtk_editable_set_text (GTK_EDITABLE (local_entry2), gtk_editable_get_text (GTK_EDITABLE (entry2)));
gtk_grid_attach (GTK_GRID (table), local_entry2, 1, 1, 1, 1);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), local_entry2);
@ -85,8 +85,8 @@ interactive_dialog_clicked (GtkButton *button,
if (response == GTK_RESPONSE_OK)
{
gtk_entry_set_text (GTK_ENTRY (entry1), gtk_entry_get_text (GTK_ENTRY (local_entry1)));
gtk_entry_set_text (GTK_ENTRY (entry2), gtk_entry_get_text (GTK_ENTRY (local_entry2)));
gtk_editable_set_text (GTK_EDITABLE (entry1), gtk_editable_get_text (GTK_EDITABLE (local_entry1)));
gtk_editable_set_text (GTK_EDITABLE (entry2), gtk_editable_get_text (GTK_EDITABLE (local_entry2)));
}
gtk_widget_destroy (dialog);

View File

@ -199,7 +199,7 @@ edit_label_done (GtkWidget *entry, gpointer data)
gtk_container_child_get (GTK_CONTAINER (fixed), entry, "x", &x, "y", &y, NULL);
label = GTK_WIDGET (g_object_get_data (G_OBJECT (entry), "label"));
gtk_label_set_text (GTK_LABEL (label), gtk_entry_get_text (GTK_ENTRY (entry)));
gtk_label_set_text (GTK_LABEL (label), gtk_editable_get_text (GTK_EDITABLE (entry)));
gtk_widget_destroy (entry);
}
@ -218,7 +218,7 @@ edit_cb (GtkWidget *child)
g_object_set_data (G_OBJECT (entry), "label", child);
gtk_entry_set_text (GTK_ENTRY (entry), gtk_label_get_text (GTK_LABEL (child)));
gtk_editable_set_text (GTK_EDITABLE (entry), gtk_label_get_text (GTK_LABEL (child)));
g_signal_connect (entry, "activate", G_CALLBACK (edit_label_done), NULL);
gtk_fixed_put (GTK_FIXED (fixed), entry, x, y);
gtk_widget_grab_focus (entry);

View File

@ -305,7 +305,7 @@ update_display (void)
char *font_desc;
char *features;
text = gtk_entry_get_text (GTK_ENTRY (entry));
text = gtk_editable_get_text (GTK_EDITABLE (entry));
if (gtk_label_get_selection_bounds (GTK_LABEL (label), &ins, &bound))
{
@ -728,7 +728,7 @@ adjustment_changed (GtkAdjustment *adjustment,
char *str;
str = g_strdup_printf ("%g", gtk_adjustment_get_value (adjustment));
gtk_entry_set_text (GTK_ENTRY (entry), str);
gtk_editable_set_text (GTK_EDITABLE (entry), str);
g_free (str);
update_display ();
@ -741,7 +741,7 @@ entry_activated (GtkEntry *entry,
gdouble value;
gchar *err = NULL;
value = g_strtod (gtk_entry_get_text (entry), &err);
value = g_strtod (gtk_editable_get_text (GTK_EDITABLE (entry)), &err);
if (err != NULL)
gtk_adjustment_set_value (adjustment, value);
}
@ -821,7 +821,7 @@ add_axis (FT_Var_Axis *ax, FT_Fixed value, int i)
gtk_grid_attach (GTK_GRID (variations_grid), axis_scale, 1, i, 1, 1);
axis_entry = gtk_entry_new ();
gtk_widget_set_valign (axis_entry, GTK_ALIGN_BASELINE);
gtk_entry_set_width_chars (GTK_ENTRY (axis_entry), 4);
gtk_editable_set_width_chars (GTK_EDITABLE (axis_entry), 4);
gtk_grid_attach (GTK_GRID (variations_grid), axis_entry, 2, i, 1, 1);
axis = g_new (Axis, 1);
@ -1639,7 +1639,7 @@ static char *text;
static void
switch_to_entry (void)
{
text = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
gtk_stack_set_visible_child_name (GTK_STACK (stack), "entry");
gtk_widget_grab_focus (entry);
}
@ -1677,7 +1677,7 @@ entry_key_press (GtkEventController *controller,
{
if (keyval == GDK_KEY_Escape)
{
gtk_entry_set_text (GTK_ENTRY (entry), text);
gtk_editable_set_text (GTK_EDITABLE (entry), text);
stop_edit ();
return GDK_EVENT_STOP;
}

View File

@ -12,7 +12,7 @@
static void
do_number (GtkButton *button, GtkEntry *entry)
{
gtk_entry_set_text (entry, gtk_button_get_label (button));
gtk_editable_set_text (GTK_EDITABLE (entry), gtk_button_get_label (button));
}
GtkWidget *

View File

@ -85,7 +85,7 @@ stop_search (GtkButton *button,
static void
clear_entry (GtkEntry *entry)
{
gtk_entry_set_text (entry, "");
gtk_editable_set_text (GTK_EDITABLE (entry), "");
}
static void

View File

@ -19,7 +19,7 @@ hex_spin_input (GtkSpinButton *spin_button,
gchar *err;
gdouble res;
buf = gtk_spin_button_get_text (spin_button);
buf = gtk_editable_get_text (GTK_EDITABLE (spin_button));
res = strtol (buf, &err, 16);
*new_val = res;
if (*err)
@ -41,8 +41,8 @@ hex_spin_output (GtkSpinButton *spin_button)
buf = g_strdup ("0x00");
else
buf = g_strdup_printf ("0x%.2X", (gint) val);
if (strcmp (buf, gtk_spin_button_get_text (spin_button)))
gtk_spin_button_set_text (spin_button, buf);
if (strcmp (buf, gtk_editable_get_text (GTK_EDITABLE (spin_button))))
gtk_editable_set_text (GTK_EDITABLE (spin_button), buf);
g_free (buf);
return TRUE;
@ -60,7 +60,7 @@ time_spin_input (GtkSpinButton *spin_button,
gchar *endh;
gchar *endm;
text = gtk_spin_button_get_text (spin_button);
text = gtk_editable_get_text (GTK_EDITABLE (spin_button));
str = g_strsplit (text, ":", 2);
if (g_strv_length (str) == 2)
@ -99,8 +99,8 @@ time_spin_output (GtkSpinButton *spin_button)
hours = gtk_adjustment_get_value (adjustment) / 60.0;
minutes = (hours - floor (hours)) * 60.0;
buf = g_strdup_printf ("%02.0f:%02.0f", floor (hours), floor (minutes + 0.5));
if (strcmp (buf, gtk_spin_button_get_text (spin_button)))
gtk_spin_button_set_text (spin_button, buf);
if (strcmp (buf, gtk_editable_get_text (GTK_EDITABLE (spin_button))))
gtk_editable_set_text (GTK_EDITABLE (spin_button), buf);
g_free (buf);
return TRUE;
@ -132,7 +132,7 @@ month_spin_input (GtkSpinButton *spin_button,
for (i = 1; i <= 12; i++)
{
tmp1 = g_ascii_strup (month[i - 1], -1);
tmp2 = g_ascii_strup (gtk_spin_button_get_text (spin_button), -1);
tmp2 = g_ascii_strup (gtk_editable_get_text (GTK_EDITABLE (spin_button)), -1);
if (strstr (tmp1, tmp2) == tmp1)
found = TRUE;
g_free (tmp1);
@ -162,8 +162,8 @@ month_spin_output (GtkSpinButton *spin_button)
for (i = 1; i <= 12; i++)
if (fabs (value - (double)i) < 1e-5)
{
if (strcmp (month[i-1], gtk_spin_button_get_text (spin_button)))
gtk_spin_button_set_text (spin_button, month[i-1]);
if (strcmp (month[i-1], gtk_editable_get_text (GTK_EDITABLE (spin_button))))
gtk_editable_set_text (GTK_EDITABLE (spin_button), month[i-1]);
}
return TRUE;

View File

@ -68,7 +68,7 @@ search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
{
const gchar *text;
text = gtk_entry_get_text (entry);
text = gtk_editable_get_text (GTK_EDITABLE (entry));
if (text[0] == '\0')
return;
@ -322,7 +322,7 @@ icon_visible_func (GtkTreeModel *model,
gboolean visible;
search = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (win->search));
search_text = gtk_entry_get_text (GTK_ENTRY (win->searchentry));
search_text = gtk_editable_get_text (GTK_EDITABLE (win->searchentry));
if (win->symbolic)
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;

View File

@ -1406,7 +1406,7 @@ open_popover_text_changed (GtkEntry *entry, GParamSpec *pspec, GtkWidget *button
{
const gchar *text;
text = gtk_entry_get_text (entry);
text = gtk_editable_get_text (GTK_EDITABLE (entry));
gtk_widget_set_sensitive (button, strlen (text) > 0);
}

View File

@ -827,7 +827,7 @@ search_text_changed (GtkEntry *entry,
GtkTextBuffer *buffer;
GtkTextIter start, match_start, match_end;
text = gtk_entry_get_text (entry);
text = gtk_editable_get_text (GTK_EDITABLE (entry));
if (text[0] == '\0')
return;

View File

@ -918,8 +918,6 @@ gtk_entry_new
gtk_entry_new_with_buffer
gtk_entry_get_buffer
gtk_entry_set_buffer
gtk_entry_set_text
gtk_entry_get_text
gtk_entry_get_text_length
gtk_entry_set_visibility
gtk_entry_get_visibility
@ -932,10 +930,6 @@ gtk_entry_set_activates_default
gtk_entry_get_activates_default
gtk_entry_set_has_frame
gtk_entry_get_has_frame
gtk_entry_set_width_chars
gtk_entry_get_width_chars
gtk_entry_set_max_width_chars
gtk_entry_get_max_width_chars
gtk_entry_set_alignment
gtk_entry_get_alignment
gtk_entry_set_placeholder_text
@ -2706,12 +2700,6 @@ gtk_spin_button_get_snap_to_ticks
gtk_spin_button_get_update_policy
gtk_spin_button_get_value
gtk_spin_button_get_wrap
gtk_spin_button_set_text
gtk_spin_button_get_text
gtk_spin_button_set_max_width_chars
gtk_spin_button_get_max_width_chars
gtk_spin_button_set_width_chars
gtk_spin_button_get_width_chars
GTK_INPUT_ERROR
<SUBSECTION Standard>
GTK_SPIN_BUTTON

View File

@ -608,7 +608,7 @@
</section>
<section>
<title>Adapt to changes in the API of GtkEntry and GtkSearchEntry</title>
<title>Adapt to changes in the API of GtkEntry, GtkSearchEntry adn GtkSpinButton</title>
<para>
The GtkEditable has been made more useful, and the core functionality of
GtkEntry has been broken out as a GtkText widget. GtkEntry, GtkSearchEntry,
@ -620,7 +620,8 @@
<para>
Use GtkEditable API for editable functionality, and widget-specific APIs for
things that go beyond the common interface. For password entries, use
GtkPasswordEntry.
GtkPasswordEntry. As an example, gtk_spin_button_set_max_width_chars()
has been removed in favor of gtk_editable_set_max_width_chars().
</para>
</section>

View File

@ -226,7 +226,7 @@ create_entry (void)
widget = gtk_entry_new ();
gtk_widget_set_halign (widget, GTK_ALIGN_FILL);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
gtk_entry_set_text (GTK_ENTRY (widget), "Entry");
gtk_editable_set_text (GTK_EDITABLE (widget), "Entry");
gtk_editable_set_position (GTK_EDITABLE (widget), -1);
return new_widget_info ("entry", widget, SMALL);
@ -320,7 +320,7 @@ create_combo_box_entry (void)
g_object_unref (model);
child = gtk_bin_get_child (GTK_BIN (widget));
gtk_entry_set_text (GTK_ENTRY (child), "Combo Box Entry");
gtk_editable_set_text (GTK_EDITABLE (child), "Combo Box Entry");
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
@ -399,7 +399,7 @@ create_search_bar (void)
widget = gtk_search_bar_new ();
entry = gtk_search_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), "Search Bar");
gtk_editable_set_text (GTK_EDITABLE (entry), "Search Bar");
gtk_container_add (GTK_CONTAINER (widget), entry);
gtk_widget_show (entry);

View File

@ -31,7 +31,7 @@ search_text_changed (GtkEntry *entry,
GtkTextBuffer *buffer;
GtkTextIter start, match_start, match_end;
text = gtk_entry_get_text (entry);
text = gtk_editable_get_text (GTK_EDITABLE (entry));
if (text[0] == '\0')
return;
@ -58,7 +58,7 @@ find_word (GtkButton *button,
const gchar *word;
word = gtk_button_get_label (button);
gtk_entry_set_text (GTK_ENTRY (win->searchentry), word);
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
}
static void

View File

@ -25,7 +25,7 @@ search_text_changed (GtkEntry *entry,
GtkTextBuffer *buffer;
GtkTextIter start, match_start, match_end;
text = gtk_entry_get_text (entry);
text = gtk_editable_get_text (GTK_EDITABLE (entry));
if (text[0] == '\0')
return;

View File

@ -29,7 +29,7 @@ search_text_changed (GtkEntry *entry,
GtkTextBuffer *buffer;
GtkTextIter start, match_start, match_end;
text = gtk_entry_get_text (entry);
text = gtk_editable_get_text (GTK_EDITABLE (entry));
if (text[0] == '\0')
return;
@ -56,7 +56,7 @@ find_word (GtkButton *button,
const gchar *word;
word = gtk_button_get_label (button);
gtk_entry_set_text (GTK_ENTRY (win->searchentry), word);
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
}
static void

View File

@ -31,7 +31,7 @@ search_text_changed (GtkEntry *entry,
GtkTextBuffer *buffer;
GtkTextIter start, match_start, match_end;
text = gtk_entry_get_text (entry);
text = gtk_editable_get_text (GTK_EDITABLE (entry));
if (text[0] == '\0')
return;
@ -58,7 +58,7 @@ find_word (GtkButton *button,
const gchar *word;
word = gtk_button_get_label (button);
gtk_entry_set_text (GTK_ENTRY (win->searchentry), word);
gtk_editable_set_text (GTK_EDITABLE (win->searchentry), word);
}
static void

View File

@ -364,7 +364,7 @@ combo_changed (GtkComboBox *combo,
str = g_strjoinv (",", accels);
g_strfreev (accels);
gtk_entry_set_text (entry, str);
gtk_editable_set_text (GTK_EDITABLE (entry), str);
}
static void
@ -389,7 +389,7 @@ response (GtkDialog *dialog,
if (!action)
return;
str = gtk_entry_get_text (entry);
str = gtk_editable_get_text (GTK_EDITABLE (entry));
accels = g_strsplit (str, ",", 0);
gtk_application_set_accels_for_action (gtk_window_get_application (user_data), action, (const gchar **) accels);

View File

@ -364,7 +364,7 @@ gtk_cell_renderer_combo_editing_done (GtkCellEditable *combo,
if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (combo)))
{
entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo)));
new_text = g_strdup (gtk_entry_get_text (entry));
new_text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
}
else
{
@ -466,8 +466,7 @@ gtk_cell_renderer_combo_start_editing (GtkCellRenderer *cell,
g_object_get (cell_text, "text", &text, NULL);
if (text)
gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo))),
text);
gtk_editable_set_text (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (combo))), text);
g_free (text);
}
else

View File

@ -273,7 +273,7 @@ gtk_cell_renderer_spin_focus_changed (GtkWidget *widget,
{
path = g_object_get_data (G_OBJECT (widget), GTK_CELL_RENDERER_SPIN_PATH);
new_text = gtk_entry_get_text (GTK_ENTRY (widget));
new_text = gtk_editable_get_text (GTK_EDITABLE (widget));
g_signal_emit_by_name (data, "edited", path, new_text);
}
}

View File

@ -1798,7 +1798,7 @@ gtk_cell_renderer_text_editing_done (GtkCellEditable *entry,
return;
path = g_object_get_data (G_OBJECT (entry), GTK_CELL_RENDERER_TEXT_PATH);
new_text = gtk_entry_get_text (GTK_ENTRY (entry));
new_text = gtk_editable_get_text (GTK_EDITABLE (entry));
g_signal_emit (data, text_cell_renderer_signals[EDITED], 0, path, new_text);
}
@ -1905,10 +1905,10 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell,
gtk_entry_set_has_frame (GTK_ENTRY (priv->entry), FALSE);
gtk_entry_set_alignment (GTK_ENTRY (priv->entry), xalign);
gtk_entry_set_width_chars (GTK_ENTRY (priv->entry), 5);
gtk_editable_set_width_chars (GTK_EDITABLE (priv->entry), 5);
if (priv->text)
gtk_entry_set_text (GTK_ENTRY (priv->entry), priv->text);
gtk_editable_set_text (GTK_EDITABLE (priv->entry), priv->text);
g_object_set_data_full (G_OBJECT (priv->entry), I_(GTK_CELL_RENDERER_TEXT_PATH), g_strdup (path), g_free);
gtk_editable_select_region (GTK_EDITABLE (priv->entry), 0, -1);

View File

@ -105,7 +105,7 @@ entry_set_rgba (GtkColorEditor *editor,
scale_round (color->red, 255),
scale_round (color->green, 255),
scale_round (color->blue, 255));
gtk_entry_set_text (GTK_ENTRY (editor->priv->entry), text);
gtk_editable_set_text (GTK_EDITABLE (editor->priv->entry), text);
editor->priv->text_changed = FALSE;
g_free (text);
}

View File

@ -2424,7 +2424,7 @@ gtk_combo_box_entry_active_changed (GtkComboBox *combo_box,
g_signal_emit (combo_box, combo_box_signals[FORMAT_ENTRY_TEXT], 0,
path_str, &text);
gtk_entry_set_text (entry, text);
gtk_editable_set_text (GTK_EDITABLE (entry), text);
g_signal_handlers_unblock_by_func (entry,
gtk_combo_box_entry_contents_changed,

View File

@ -583,7 +583,7 @@ gtk_combo_box_text_get_active_text (GtkComboBoxText *combo_box)
GtkWidget *entry;
entry = gtk_bin_get_child (GTK_BIN (combo_box));
text = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
}
else if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo_box), &iter))
{

View File

@ -1883,25 +1883,6 @@ gtk_entry_set_buffer (GtkEntry *entry,
gtk_text_set_buffer (GTK_TEXT (priv->text), buffer);
}
/**
* gtk_entry_set_text:
* @entry: a #GtkEntry
* @text: the new text
*
* Sets the text in the widget to the given
* value, replacing the current contents.
*
* See gtk_entry_buffer_set_text().
*/
void
gtk_entry_set_text (GtkEntry *entry,
const gchar *text)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
gtk_editable_set_text (GTK_EDITABLE (priv->text), text);
}
/**
* gtk_entry_set_visibility:
* @entry: a #GtkEntry
@ -2051,31 +2032,6 @@ gtk_entry_get_overwrite_mode (GtkEntry *entry)
}
/**
* gtk_entry_get_text:
* @entry: a #GtkEntry
*
* Retrieves the contents of the entry widget.
* See also gtk_editable_get_chars().
*
* This is equivalent to getting @entry's #GtkEntryBuffer and calling
* gtk_entry_buffer_get_text() on it.
*
* Returns: a pointer to the contents of the widget as a
* string. This string points to internally allocated
* storage in the widget and must not be freed, modified or
* stored.
**/
const gchar*
gtk_entry_get_text (GtkEntry *entry)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_val_if_fail (GTK_IS_ENTRY (entry), NULL);
return gtk_editable_get_text (GTK_EDITABLE (priv->text));
}
/**
* gtk_entry_set_max_length:
* @entry: a #GtkEntry
@ -2192,83 +2148,6 @@ gtk_entry_get_activates_default (GtkEntry *entry)
return gtk_text_get_activates_default (GTK_TEXT (priv->text));
}
/**
* gtk_entry_set_width_chars:
* @entry: a #GtkEntry
* @n_chars: width in chars
*
* Changes the size request of the entry to be about the right size
* for @n_chars characters. Note that it changes the size
* request, the size can still be affected by
* how you pack the widget into containers. If @n_chars is -1, the
* size reverts to the default entry size.
**/
void
gtk_entry_set_width_chars (GtkEntry *entry,
gint n_chars)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_if_fail (GTK_IS_ENTRY (entry));
gtk_editable_set_width_chars (GTK_EDITABLE (priv->text), n_chars);
}
/**
* gtk_entry_get_width_chars:
* @entry: a #GtkEntry
*
* Gets the value set by gtk_entry_set_width_chars().
*
* Returns: number of chars to request space for, or negative if unset
**/
gint
gtk_entry_get_width_chars (GtkEntry *entry)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_val_if_fail (GTK_IS_ENTRY (entry), 0);
return gtk_editable_get_width_chars (GTK_EDITABLE (priv->text));
}
/**
* gtk_entry_set_max_width_chars:
* @entry: a #GtkEntry
* @n_chars: the new desired maximum width, in characters
*
* Sets the desired maximum width in characters of @entry.
*/
void
gtk_entry_set_max_width_chars (GtkEntry *entry,
gint n_chars)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_if_fail (GTK_IS_ENTRY (entry));
gtk_editable_set_max_width_chars (GTK_EDITABLE (priv->text), n_chars);
}
/**
* gtk_entry_get_max_width_chars:
* @entry: a #GtkEntry
*
* Retrieves the desired maximum width of @entry, in characters.
* See gtk_entry_set_max_width_chars().
*
* Returns: the maximum width of the entry, in characters
*/
gint
gtk_entry_get_max_width_chars (GtkEntry *entry)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
g_return_val_if_fail (GTK_IS_ENTRY (entry), 0);
return gtk_editable_get_max_width_chars (GTK_EDITABLE (priv->text));
}
/**
* gtk_entry_set_has_frame:
* @entry: a #GtkEntry

View File

@ -184,27 +184,6 @@ void gtk_entry_set_activates_default (GtkEntry *entry,
GDK_AVAILABLE_IN_ALL
gboolean gtk_entry_get_activates_default (GtkEntry *entry);
GDK_AVAILABLE_IN_ALL
void gtk_entry_set_width_chars (GtkEntry *entry,
gint n_chars);
GDK_AVAILABLE_IN_ALL
gint gtk_entry_get_width_chars (GtkEntry *entry);
GDK_AVAILABLE_IN_ALL
void gtk_entry_set_max_width_chars (GtkEntry *entry,
gint n_chars);
GDK_AVAILABLE_IN_ALL
gint gtk_entry_get_max_width_chars (GtkEntry *entry);
/* Somewhat more convenient than the GtkEditable generic functions
*/
GDK_AVAILABLE_IN_ALL
void gtk_entry_set_text (GtkEntry *entry,
const gchar *text);
/* returns a reference to the text */
GDK_AVAILABLE_IN_ALL
const gchar* gtk_entry_get_text (GtkEntry *entry);
GDK_AVAILABLE_IN_ALL
void gtk_entry_set_alignment (GtkEntry *entry,
gfloat xalign);

View File

@ -1184,7 +1184,7 @@ gtk_entry_completion_complete (GtkEntryCompletion *completion)
g_free (completion->priv->case_normalized_key);
tmp = g_utf8_normalize (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)),
tmp = g_utf8_normalize (gtk_editable_get_text (GTK_EDITABLE (completion->priv->entry)),
-1, G_NORMALIZE_ALL);
completion->priv->case_normalized_key = g_utf8_casefold (tmp, -1);
g_free (tmp);
@ -1565,7 +1565,7 @@ gtk_entry_completion_match_selected (GtkEntryCompletion *completion,
gchar *str = NULL;
gtk_tree_model_get (model, iter, completion->priv->text_column, &str, -1);
gtk_entry_set_text (GTK_ENTRY (completion->priv->entry), str ? str : "");
gtk_editable_set_text (GTK_EDITABLE (completion->priv->entry), str ? str : "");
/* move cursor to the end */
gtk_editable_set_position (GTK_EDITABLE (completion->priv->entry), -1);
@ -1673,7 +1673,7 @@ gtk_entry_completion_real_insert_prefix (GtkEntryCompletion *completion,
prefix_len = g_utf8_strlen (prefix, -1);
key = gtk_entry_get_text (GTK_ENTRY (completion->priv->entry));
key = gtk_editable_get_text (GTK_EDITABLE (completion->priv->entry));
key_len = g_utf8_strlen (key, -1);
if (prefix_len > key_len)
@ -2005,7 +2005,7 @@ gtk_entry_completion_timeout (gpointer data)
completion->priv->completion_timeout = 0;
if (completion->priv->filter_model &&
g_utf8_strlen (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)), -1)
g_utf8_strlen (gtk_editable_get_text (GTK_EDITABLE (completion->priv->entry)), -1)
>= completion->priv->minimum_key_length)
{
gint matches;
@ -2160,8 +2160,8 @@ gtk_entry_completion_key_pressed (GtkEventControllerKey *controller,
if (completion->priv->inline_selection &&
completion->priv->completion_prefix)
{
gtk_entry_set_text (GTK_ENTRY (completion->priv->entry),
completion->priv->completion_prefix);
gtk_editable_set_text (GTK_EDITABLE (completion->priv->entry),
completion->priv->completion_prefix);
gtk_editable_set_position (GTK_EDITABLE (widget), -1);
}
}
@ -2189,7 +2189,7 @@ gtk_entry_completion_key_pressed (GtkEventControllerKey *controller,
model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
if (completion->priv->completion_prefix == NULL)
completion->priv->completion_prefix = g_strdup (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)));
completion->priv->completion_prefix = g_strdup (gtk_editable_get_text (GTK_EDITABLE (completion->priv->entry)));
g_signal_emit_by_name (completion, "cursor-on-match", model,
&child_iter, &entry_set);
@ -2206,8 +2206,8 @@ gtk_entry_completion_key_pressed (GtkEventControllerKey *controller,
if (completion->priv->inline_selection &&
completion->priv->completion_prefix)
{
gtk_entry_set_text (GTK_ENTRY (completion->priv->entry),
completion->priv->completion_prefix);
gtk_editable_set_text (GTK_EDITABLE (completion->priv->entry),
completion->priv->completion_prefix);
gtk_editable_set_position (GTK_EDITABLE (widget), -1);
}
}
@ -2238,10 +2238,10 @@ gtk_entry_completion_key_pressed (GtkEventControllerKey *controller,
if (keyval == GDK_KEY_Escape)
{
if (completion->priv->completion_prefix)
gtk_entry_set_text (GTK_ENTRY (completion->priv->entry),
completion->priv->completion_prefix);
gtk_editable_set_text (GTK_EDITABLE (completion->priv->entry),
completion->priv->completion_prefix);
else
gtk_entry_set_text (GTK_ENTRY (completion->priv->entry), "");
gtk_editable_set_text (GTK_EDITABLE (completion->priv->entry), "");
}
/* Move the cursor to the end for Right/Esc */
@ -2312,7 +2312,7 @@ keypress_completion_out:
completion->priv->text_column, &str,
-1);
gtk_entry_set_text (GTK_ENTRY (widget), str);
gtk_editable_set_text (GTK_EDITABLE (widget), str);
/* move the cursor to the end */
gtk_editable_set_position (GTK_EDITABLE (widget), -1);

View File

@ -54,7 +54,7 @@ typedef struct _GtkEntryCompletionPrivate GtkEntryCompletionPrivate;
* Note that @key is normalized and case-folded (see g_utf8_normalize()
* and g_utf8_casefold()). If this is not appropriate, match functions
* have access to the unmodified key via
* `gtk_entry_get_text (GTK_ENTRY (gtk_entry_completion_get_entry ()))`.
* `gtk_editable_get_text (GTK_EDITABLE (gtk_entry_completion_get_entry ()))`.
*
* Returns: %TRUE if @iter should be displayed as a possible completion
* for @key

View File

@ -806,7 +806,7 @@ insert_text_callback (GtkFileChooserEntry *chooser_entry,
(new_text_length > 0 &&
*position <= 1 &&
gtk_entry_get_text_length (GTK_ENTRY (chooser_entry)) >= 2 &&
gtk_entry_get_text (GTK_ENTRY (chooser_entry))[1] == ':'))
gtk_editable_get_text (GTK_EDITABLE (chooser_entry))[1] == ':'))
{
gtk_widget_error_bell (GTK_WIDGET (chooser_entry));
g_signal_stop_emission_by_name (chooser_entry, "insert_text");
@ -825,7 +825,7 @@ delete_text_callback (GtkFileChooserEntry *chooser_entry,
/* If deleting a drive letter, delete the colon, too */
if (start_pos == 0 && end_pos == 1 &&
gtk_entry_get_text_length (GTK_ENTRY (chooser_entry)) >= 2 &&
gtk_entry_get_text (GTK_ENTRY (chooser_entry))[1] == ':')
gtk_editable_get_text (GTK_EDITABLE (chooser_entry))[1] == ':')
{
g_signal_handlers_block_by_func (chooser_entry,
G_CALLBACK (delete_text_callback),
@ -913,7 +913,7 @@ _gtk_file_chooser_entry_get_current_folder (GtkFileChooserEntry *chooser_entry)
g_return_val_if_fail (GTK_IS_FILE_CHOOSER_ENTRY (chooser_entry), NULL);
return gtk_file_chooser_get_directory_for_text (chooser_entry,
gtk_entry_get_text (GTK_ENTRY (chooser_entry)));
gtk_editable_get_text (GTK_EDITABLE (chooser_entry)));
}
/**
@ -935,7 +935,7 @@ _gtk_file_chooser_entry_get_file_part (GtkFileChooserEntry *chooser_entry)
g_return_val_if_fail (GTK_IS_FILE_CHOOSER_ENTRY (chooser_entry), NULL);
text = gtk_entry_get_text (GTK_ENTRY (chooser_entry));
text = gtk_editable_get_text (GTK_EDITABLE (chooser_entry));
last_slash = strrchr (text, G_DIR_SEPARATOR);
if (last_slash)
return last_slash + 1;
@ -1044,7 +1044,7 @@ _gtk_file_chooser_entry_select_filename (GtkFileChooserEntry *chooser_entry)
if (chooser_entry->action == GTK_FILE_CHOOSER_ACTION_SAVE)
{
str = gtk_entry_get_text (GTK_ENTRY (chooser_entry));
str = gtk_editable_get_text (GTK_EDITABLE (chooser_entry));
ext = g_strrstr (str, ".");
if (ext)

View File

@ -969,7 +969,7 @@ new_folder_popover_active (GtkWidget *button,
{
GtkFileChooserWidgetPrivate *priv = impl->priv;
gtk_entry_set_text (GTK_ENTRY (priv->new_folder_name_entry), "");
gtk_editable_set_text (GTK_EDITABLE (priv->new_folder_name_entry), "");
gtk_widget_set_sensitive (priv->new_folder_create_button, FALSE);
gtk_file_chooser_error_stack_set_error (GTK_FILE_CHOOSER_ERROR_STACK (priv->new_folder_error_stack),
FALSE,
@ -1105,7 +1105,7 @@ new_folder_name_changed (GtkEntry *entry,
check_valid_child_name (impl,
priv->current_folder,
gtk_entry_get_text (entry),
gtk_editable_get_text (entry),
TRUE,
NULL,
priv->new_folder_error_stack,
@ -1121,7 +1121,7 @@ new_folder_create_clicked (GtkButton *button,
GFile *file;
const gchar *name;
name = gtk_entry_get_text (GTK_ENTRY (priv->new_folder_name_entry));
name = gtk_editable_get_text (GTK_EDITABLE (priv->new_folder_name_entry));
file = g_file_get_child_for_display_name (priv->current_folder, name, &error);
gtk_popover_popdown (GTK_POPOVER (priv->new_folder_popover));
@ -1570,7 +1570,7 @@ rename_file_name_changed (GtkEntry *entry,
check_valid_child_name (impl,
priv->current_folder,
gtk_entry_get_text (entry),
gtk_editable_get_text (GTK_EDITABLE (entry)),
file_type == G_FILE_TYPE_DIRECTORY,
priv->rename_file_source_file,
priv->rename_file_error_stack,
@ -1594,7 +1594,7 @@ rename_file_rename_clicked (GtkButton *button,
gtk_popover_popdown (GTK_POPOVER (priv->rename_file_popover));
new_name = gtk_entry_get_text (GTK_ENTRY (priv->rename_file_name_entry));
new_name = gtk_editable_get_text (GTK_EDITABLE (priv->rename_file_name_entry));
dest = g_file_get_parent (priv->rename_file_source_file);
if (dest)
@ -1638,7 +1638,7 @@ rename_selected_cb (GtkTreeModel *model,
rect.x, rect.y, &rect.x, &rect.y);
filename = g_file_get_basename (priv->rename_file_source_file);
gtk_entry_set_text (GTK_ENTRY(priv->rename_file_name_entry), filename);
gtk_editable_set_text (GTK_EDITABLE (priv->rename_file_name_entry), filename);
g_free (filename);
gtk_popover_set_pointing_to (GTK_POPOVER (priv->rename_file_popover), &rect);
@ -2507,7 +2507,7 @@ location_entry_setup (GtkFileChooserWidget *impl)
_gtk_file_chooser_entry_set_action (GTK_FILE_CHOOSER_ENTRY (priv->location_entry), priv->action);
_gtk_file_chooser_entry_set_file_filter (GTK_FILE_CHOOSER_ENTRY (priv->location_entry),
priv->current_filter);
gtk_entry_set_width_chars (GTK_ENTRY (priv->location_entry), 45);
gtk_editable_set_width_chars (GTK_EDITABLE (priv->location_entry), 45);
gtk_entry_set_activates_default (GTK_ENTRY (priv->location_entry), TRUE);
gtk_widget_set_hexpand (priv->location_entry, TRUE);
}
@ -5127,7 +5127,7 @@ update_chooser_entry (GtkFileChooserWidget *impl)
if (change_entry && !priv->auto_selecting_first_row)
{
g_signal_handlers_block_by_func (priv->location_entry, G_CALLBACK (location_entry_changed_cb), impl);
gtk_entry_set_text (GTK_ENTRY (priv->location_entry), priv->browse_files_last_selected_name);
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), priv->browse_files_last_selected_name);
g_signal_handlers_unblock_by_func (priv->location_entry, G_CALLBACK (location_entry_changed_cb), impl);
if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE)
@ -5161,7 +5161,7 @@ update_chooser_entry (GtkFileChooserWidget *impl)
priv->browse_files_last_selected_name = NULL;
g_signal_handlers_block_by_func (priv->location_entry, G_CALLBACK (location_entry_changed_cb), impl);
gtk_entry_set_text (GTK_ENTRY (priv->location_entry), "");
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), "");
g_signal_handlers_unblock_by_func (priv->location_entry, G_CALLBACK (location_entry_changed_cb), impl);
return;
}
@ -5175,7 +5175,7 @@ update_chooser_entry (GtkFileChooserWidget *impl)
int len;
gboolean clear_entry;
entry_text = gtk_entry_get_text (GTK_ENTRY (priv->location_entry));
entry_text = gtk_editable_get_text (GTK_EDITABLE (priv->location_entry));
len = strlen (entry_text);
if (len != 0)
{
@ -5199,7 +5199,7 @@ update_chooser_entry (GtkFileChooserWidget *impl)
if (clear_entry)
{
g_signal_handlers_block_by_func (priv->location_entry, G_CALLBACK (location_entry_changed_cb), impl);
gtk_entry_set_text (GTK_ENTRY (priv->location_entry), "");
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), "");
g_signal_handlers_unblock_by_func (priv->location_entry, G_CALLBACK (location_entry_changed_cb), impl);
}
}
@ -5389,7 +5389,7 @@ update_current_folder_get_info_cb (GCancellable *cancellable,
priv->current_folder);
if (data->clear_entry)
gtk_entry_set_text (GTK_ENTRY (priv->location_entry), "");
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), "");
}
/* Create a new list model. This is slightly evil; we store the result value
@ -5498,7 +5498,7 @@ gtk_file_chooser_widget_set_current_name (GtkFileChooser *chooser,
priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
pending_select_files_free (impl);
gtk_entry_set_text (GTK_ENTRY (priv->location_entry), name);
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), name);
}
static gchar *
@ -5511,7 +5511,7 @@ gtk_file_chooser_widget_get_current_name (GtkFileChooser *chooser)
priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER,
NULL);
return g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->location_entry)));
return g_strdup (gtk_editable_get_text (GTK_EDITABLE (priv->location_entry)));
}
static gboolean
@ -5692,7 +5692,7 @@ check_save_entry (GtkFileChooserWidget *impl,
chooser_entry = GTK_FILE_CHOOSER_ENTRY (priv->location_entry);
if (strlen (gtk_entry_get_text (GTK_ENTRY (chooser_entry))) == 0)
if (strlen (gtk_editable_get_text (GTK_EDITABLE (chooser_entry))) == 0)
{
*file_ret = NULL;
*is_well_formed_ret = TRUE;
@ -7797,7 +7797,7 @@ location_set_user_text (GtkFileChooserWidget *impl,
{
GtkFileChooserWidgetPrivate *priv = impl->priv;
gtk_entry_set_text (GTK_ENTRY (priv->location_entry), path);
gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), path);
gtk_editable_set_position (GTK_EDITABLE (priv->location_entry), -1);
}

View File

@ -420,7 +420,7 @@ output_cb (GtkSpinButton *spin,
adjustment = gtk_spin_button_get_adjustment (spin);
value = gtk_adjustment_get_value (adjustment);
text = g_strdup_printf ("%2.4g", value);
gtk_spin_button_set_text (spin, text);
gtk_editable_set_text (GTK_EDITABLE (spin), text);
g_free (text);
return TRUE;
@ -844,7 +844,7 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser)
priv->language = pango_language_get_default ();
/* Set default preview text */
gtk_entry_set_text (GTK_ENTRY (priv->preview), priv->preview_text);
gtk_editable_set_text (GTK_EDITABLE (priv->preview), priv->preview_text);
gtk_font_chooser_widget_update_preview_attributes (fontchooser);
@ -2366,7 +2366,7 @@ gtk_font_chooser_widget_set_preview_text (GtkFontChooserWidget *fontchooser,
g_free (priv->preview_text);
priv->preview_text = g_strdup (text);
gtk_entry_set_text (GTK_ENTRY (priv->preview), text);
gtk_editable_set_text (GTK_EDITABLE (priv->preview), text);
g_object_notify (G_OBJECT (fontchooser), "preview-text");

View File

@ -333,19 +333,19 @@ pw_dialog_got_response (GtkDialog *dialog,
if (priv->username_entry)
{
text = gtk_entry_get_text (GTK_ENTRY (priv->username_entry));
text = gtk_editable_get_text (GTK_EDITABLE (priv->username_entry));
g_mount_operation_set_username (op, text);
}
if (priv->domain_entry)
{
text = gtk_entry_get_text (GTK_ENTRY (priv->domain_entry));
text = gtk_editable_get_text (GTK_EDITABLE (priv->domain_entry));
g_mount_operation_set_domain (op, text);
}
if (priv->password_entry)
{
text = gtk_entry_get_text (GTK_ENTRY (priv->password_entry));
text = gtk_editable_get_text (GTK_EDITABLE (priv->password_entry));
g_mount_operation_set_password (op, text);
}
@ -371,7 +371,7 @@ entry_has_input (GtkWidget *entry_widget)
if (entry_widget == NULL)
return TRUE;
text = gtk_entry_get_text (GTK_ENTRY (entry_widget));
text = gtk_editable_get_text (GTK_EDITABLE (entry_widget));
return text != NULL && text[0] != '\0';
}
@ -478,7 +478,7 @@ table_add_entry (GtkMountOperation *operation,
gtk_widget_set_hexpand (entry, TRUE);
if (value)
gtk_entry_set_text (GTK_ENTRY (entry), value);
gtk_editable_set_text (GTK_EDITABLE (entry), value);
gtk_grid_attach (GTK_GRID (operation->priv->grid), label, 0, row, 1, 1);
gtk_grid_attach (GTK_GRID (operation->priv->grid), entry, 1, row, 1, 1);

View File

@ -2575,7 +2575,7 @@ rename_entry_changed (GtkEntry *entry,
GList *rows;
GList *l;
new_name = gtk_entry_get_text (GTK_ENTRY (sidebar->rename_entry));
new_name = gtk_editable_get_text (GTK_EDITABLE (sidebar->rename_entry));
if (strcmp (new_name, "") == 0)
{
@ -2615,7 +2615,7 @@ do_rename (GtkButton *button,
gchar *new_text;
GFile *file;
new_text = g_strdup (gtk_entry_get_text (GTK_ENTRY (sidebar->rename_entry)));
new_text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (sidebar->rename_entry)));
file = g_file_new_for_uri (sidebar->rename_uri);
if (!_gtk_bookmarks_manager_has_bookmark (sidebar->bookmarks_manager, file))
@ -2764,7 +2764,7 @@ show_rename_popover (GtkSidebarRow *row)
g_free (sidebar->rename_uri);
sidebar->rename_uri = g_strdup (uri);
gtk_entry_set_text (GTK_ENTRY (sidebar->rename_entry), name);
gtk_editable_set_text (GTK_EDITABLE (sidebar->rename_entry), name);
gtk_popover_set_relative_to (GTK_POPOVER (sidebar->rename_popover), GTK_WIDGET (row));
setup_popover_shadowing (sidebar->rename_popover);

View File

@ -1238,7 +1238,7 @@ server_mount_ready_cb (GObject *source_file,
* Otherwise, the user would lost the typed address even if it fails
* to connect.
*/
gtk_entry_set_text (GTK_ENTRY (priv->address_entry), "");
gtk_editable_set_text (GTK_EDITABLE (priv->address_entry), "");
if (priv->should_open_location)
emit_open_location (view, location, priv->open_flags);
@ -1814,7 +1814,7 @@ on_connect_button_clicked (GtkPlacesView *view)
if (!gtk_widget_get_sensitive (priv->connect_button))
return;
uri = gtk_entry_get_text (GTK_ENTRY (priv->address_entry));
uri = gtk_editable_get_text (GTK_EDITABLE (priv->address_entry));
if (uri != NULL && uri[0] != '\0')
file = g_file_new_for_commandline_arg (uri);
@ -1842,7 +1842,7 @@ on_address_entry_text_changed (GtkPlacesView *view)
priv = gtk_places_view_get_instance_private (view);
supported = FALSE;
supported_protocols = g_vfs_get_supported_uri_schemes (g_vfs_get_default ());
address = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->address_entry)));
address = g_strdup (gtk_editable_get_text (GTK_EDITABLE (priv->address_entry)));
scheme = g_uri_parse_scheme (address);
if (!supported_protocols)
@ -1897,7 +1897,7 @@ on_recent_servers_listbox_row_activated (GtkPlacesView *view,
priv = gtk_places_view_get_instance_private (view);
uri = g_object_get_data (G_OBJECT (row), "uri");
gtk_entry_set_text (GTK_ENTRY (priv->address_entry), uri);
gtk_editable_set_text (GTK_EDITABLE (priv->address_entry), uri);
gtk_widget_hide (priv->recent_servers_popover);
}
@ -2196,7 +2196,7 @@ gtk_places_view_map (GtkWidget *widget)
priv = gtk_places_view_get_instance_private (GTK_PLACES_VIEW (widget));
gtk_entry_set_text (GTK_ENTRY (priv->address_entry), "");
gtk_editable_set_text (GTK_EDITABLE (priv->address_entry), "");
GTK_WIDGET_CLASS (gtk_places_view_parent_class)->map (widget);
}

View File

@ -591,7 +591,7 @@ store_entry (GtkEntry *entry,
g_free (*data);
}
*data = g_strdup (gtk_entry_get_text (entry));
*data = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
}
static void
@ -710,7 +710,7 @@ request_password (GtkPrintBackend *backend,
focus = entry;
if (ai_default[i] != NULL)
gtk_entry_set_text (GTK_ENTRY (entry), ai_default[i]);
gtk_editable_set_text (GTK_EDITABLE (entry), ai_default[i]);
gtk_entry_set_visibility (GTK_ENTRY (entry), ai_visible[i]);
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);

View File

@ -393,7 +393,7 @@ combo_box_get (GtkWidget *combo, gboolean *custom)
{
if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (combo)))
{
value = g_strdup (gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo)))));
value = g_strdup (gtk_editable_get_text (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (combo)))));
*custom = TRUE;
}
@ -673,7 +673,7 @@ combo_changed_cb (GtkWidget *combo,
entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo)));
gtk_entry_set_text (entry, filtered_val);
gtk_editable_set_text (GTK_EDITABLE (entry), filtered_val);
}
value = filtered_val;
}
@ -693,7 +693,7 @@ entry_changed_cb (GtkWidget *entry,
const gchar *value;
g_signal_handler_block (priv->source, priv->source_changed_handler);
value = gtk_entry_get_text (GTK_ENTRY (entry));
value = gtk_editable_get_text (GTK_EDITABLE (entry));
if (value)
gtk_printer_option_set (priv->source, value);
g_signal_handler_unblock (priv->source, priv->source_changed_handler);
@ -970,7 +970,7 @@ update_widgets (GtkPrinterOptionWidget *widget)
alternative_set (priv->box, source->value);
break;
case GTK_PRINTER_OPTION_TYPE_STRING:
gtk_entry_set_text (GTK_ENTRY (priv->entry), source->value);
gtk_editable_set_text (GTK_EDITABLE (priv->entry), source->value);
break;
case GTK_PRINTER_OPTION_TYPE_PICKONE_PASSWORD:
case GTK_PRINTER_OPTION_TYPE_PICKONE_PASSCODE:
@ -984,7 +984,7 @@ update_widgets (GtkPrinterOptionWidget *widget)
if (gtk_printer_option_has_choice (source, source->value))
combo_box_set (priv->combo, source->value);
else
gtk_entry_set_text (entry, source->value);
gtk_editable_set_text (GTK_EDITABLE (entry), source->value);
break;
}

View File

@ -1467,7 +1467,7 @@ update_print_at_option (GtkPrintUnixDialog *dialog)
{
const gchar *text;
text = gtk_entry_get_text (GTK_ENTRY (priv->print_at_entry));
text = gtk_editable_get_text (GTK_EDITABLE (priv->print_at_entry));
gtk_printer_option_set (option, text);
}
}
@ -1488,7 +1488,7 @@ setup_print_at (GtkPrintUnixDialog *dialog)
gtk_widget_set_sensitive (priv->print_at_radio, FALSE);
gtk_widget_set_sensitive (priv->print_at_entry, FALSE);
gtk_widget_set_sensitive (priv->print_hold_radio, FALSE);
gtk_entry_set_text (GTK_ENTRY (priv->print_at_entry), "");
gtk_editable_set_text (GTK_EDITABLE (priv->print_at_entry), "");
return FALSE;
}
@ -1515,7 +1515,7 @@ setup_print_at (GtkPrintUnixDialog *dialog)
option = gtk_printer_option_set_lookup (priv->options, "gtk-print-time-text");
if (option != NULL)
gtk_entry_set_text (GTK_ENTRY (priv->print_at_entry), option->value);
gtk_editable_set_text (GTK_EDITABLE (priv->print_at_entry), option->value);
priv->updating_print_at = FALSE;
@ -1653,7 +1653,7 @@ update_dialog_from_capabilities (GtkPrintUnixDialog *dialog)
const gchar *copies;
GtkWidget *button;
copies = gtk_spin_button_get_text (GTK_SPIN_BUTTON (priv->copies_spin));
copies = gtk_editable_get_text (GTK_EDITABLE (priv->copies_spin));
can_collate = (*copies != '\0' && atoi (copies) > 1);
caps = priv->manual_capabilities | priv->printer_capabilities;
@ -2358,7 +2358,7 @@ dialog_get_page_ranges (GtkPrintUnixDialog *dialog,
GtkPageRange *ranges;
gint start, end;
text = gtk_entry_get_text (GTK_ENTRY (priv->page_range_entry));
text = gtk_editable_get_text (GTK_EDITABLE (priv->page_range_entry));
if (*text == 0)
{
@ -2449,7 +2449,7 @@ dialog_set_page_ranges (GtkPrintUnixDialog *dialog,
g_string_append (s, ",");
}
gtk_entry_set_text (GTK_ENTRY (priv->page_range_entry), s->str);
gtk_editable_set_text (GTK_EDITABLE (priv->page_range_entry), s->str);
g_string_free (s, TRUE);
}
@ -2529,7 +2529,7 @@ dialog_get_n_copies (GtkPrintUnixDialog *dialog)
adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->copies_spin));
text = gtk_spin_button_get_text (GTK_SPIN_BUTTON (priv->copies_spin));
text = gtk_editable_get_text (GTK_EDITABLE (priv->copies_spin));
n_copies = g_ascii_strtoull (text, &endptr, 0);
if (gtk_widget_is_sensitive (dialog->priv->copies_spin))

View File

@ -549,7 +549,7 @@ gtk_shortcuts_window__entry__changed (GtkShortcutsWindow *self,
gpointer value;
gboolean has_result;
text = gtk_entry_get_text (GTK_ENTRY (search_entry));
text = gtk_editable_get_text (GTK_EDITABLE (search_entry));
if (!text || !*text)
{

View File

@ -394,7 +394,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
*
* The ::input signal can be used to influence the conversion of
* the users input into a double value. The signal handler is
* expected to use gtk_spin_button_get_text() to retrieve the text of
* expected to use gtk_editable_get_text() to retrieve the text of
* the spinbutton and set @new_value to the new value.
*
* The default conversion uses g_strtod().
@ -2216,121 +2216,3 @@ gtk_spin_button_update (GtkSpinButton *spin_button)
else
gtk_spin_button_set_value (spin_button, val);
}
/**
* gtk_spin_button_get_text:
* @spin_button: a #GtkSpinButton
*
* Returns the text shown in the entry.
*
* Returns: (transfer none): The current text shown in the entry area of @spin_button.
*/
const char *
gtk_spin_button_get_text (GtkSpinButton *spin_button)
{
GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), NULL);
return gtk_editable_get_text (GTK_EDITABLE (priv->entry));
}
/**
* gtk_spin_button_set_text:
* @spin_button: a #GtkSpinButton
* @text: The text to set
*
* Sets the current text of the spinbutton. Note that setting this will not change
* the value of the adjustment @spin_button.
*/
void
gtk_spin_button_set_text (GtkSpinButton *spin_button,
const char *text)
{
GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
gtk_editable_set_text (GTK_EDITABLE (priv->entry), text);
}
/**
* gtk_spin_button_get_max_width_chars:
* @spin_button: a #GtkSpinButton
*
* Retrieves the desired maximum width of @spin_button, in characters.
* Note that this only applies to the entry area of @spin_button, not the
* spin button. This is especially important for horizontal spinbuttons.
*
* See also #GtkEntry:max-width-chars
*
* Returns: the maximum width of the spin button, in characters
*/
int
gtk_spin_button_get_max_width_chars (GtkSpinButton *spin_button)
{
GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), -1);
return gtk_editable_get_max_width_chars (GTK_EDITABLE (priv->entry));
}
/**
* gtk_spin_button_set_max_width_chars:
* @spin_button: a #GtkSpinButton
* @max_width_chars: new desired maximum width in chars
*
* Sets the desired maximum width of @spin_button, in characters.
* Note that this only applies to the entry area of @spin_button, not the
* spin button. This is especially important for horizontal spinbuttons.
*/
void
gtk_spin_button_set_max_width_chars (GtkSpinButton *spin_button,
int max_width_chars)
{
GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
gtk_editable_set_max_width_chars (GTK_EDITABLE (priv->entry), max_width_chars);
}
/**
* gtk_spin_button_get_width_chars:
* @spin_button: a #GtkSpinButton
*
* Get the value set by gtk_spin_button_set_width_chars(). Note that this
* value only applies to the entry area of @spin_button.
*
* Returns: The number of characters to request space for in the entry
* area of @spin_button
*/
int
gtk_spin_button_get_width_chars (GtkSpinButton *spin_button)
{
GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), -1);
return gtk_editable_get_width_chars (GTK_EDITABLE (priv->entry));
}
/**
* gtk_spin_button_set_width_chars:
* @spin_button: a #GtkSpinButton
* @width_chars: desired width in characters
*
* Changes the size request of the entry area of @spin_button
* to be about the right size for @width_chars characters.
*/
void
gtk_spin_button_set_width_chars (GtkSpinButton *spin_button,
int width_chars)
{
GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
gtk_editable_set_width_chars (GTK_EDITABLE (priv->entry), width_chars);
}

View File

@ -223,21 +223,6 @@ GDK_AVAILABLE_IN_ALL
gboolean gtk_spin_button_get_snap_to_ticks (GtkSpinButton *spin_button);
GDK_AVAILABLE_IN_ALL
void gtk_spin_button_update (GtkSpinButton *spin_button);
GDK_AVAILABLE_IN_ALL
const char * gtk_spin_button_get_text (GtkSpinButton *spin_button);
GDK_AVAILABLE_IN_ALL
void gtk_spin_button_set_text (GtkSpinButton *spin_button,
const char *text);
GDK_AVAILABLE_IN_ALL
int gtk_spin_button_get_max_width_chars (GtkSpinButton *spin_button);
GDK_AVAILABLE_IN_ALL
void gtk_spin_button_set_max_width_chars (GtkSpinButton *spin_button,
int max_width_chars);
GDK_AVAILABLE_IN_ALL
int gtk_spin_button_get_width_chars (GtkSpinButton *spin_button);
GDK_AVAILABLE_IN_ALL
void gtk_spin_button_set_width_chars (GtkSpinButton *spin_button,
int width_chars);

View File

@ -14045,7 +14045,7 @@ gtk_tree_view_search_move (GtkWidget *window,
GtkTreeModel *model;
GtkTreeSelection *selection;
text = gtk_entry_get_text (GTK_ENTRY (tree_view->priv->search_entry));
text = gtk_editable_get_text (GTK_EDITABLE (tree_view->priv->search_entry));
g_return_val_if_fail (text != NULL, FALSE);

View File

@ -142,7 +142,7 @@ variant_editor_set_value (GtkWidget *editor,
else if (g_variant_type_equal (type, G_VARIANT_TYPE_STRING))
{
GtkEntry *entry = GTK_ENTRY (editor);
gtk_entry_set_text (entry, g_variant_get_string (value, NULL));
gtk_editable_set_text (GTK_EDITABLE (entry), g_variant_get_string (value, NULL));
}
else
{
@ -155,7 +155,7 @@ variant_editor_set_value (GtkWidget *editor,
g_list_free (children);
text = g_variant_print (value, FALSE);
gtk_entry_set_text (entry, text);
gtk_editable_set_text (GTK_EDITABLE (entry), text);
g_free (text);
}
@ -177,7 +177,7 @@ variant_editor_get_value (GtkWidget *editor)
else if (g_variant_type_equal (type, G_VARIANT_TYPE_STRING))
{
GtkEntry *entry = GTK_ENTRY (editor);
value = g_variant_new_string (gtk_entry_get_text (entry));
value = g_variant_new_string (gtk_editable_get_text (GTK_EDITABLE (entry)));
}
else
{
@ -187,7 +187,7 @@ variant_editor_get_value (GtkWidget *editor)
children = gtk_container_get_children (GTK_CONTAINER (editor));
entry = children->data;
text = gtk_entry_get_text (entry);
text = gtk_editable_get_text (GTK_EDITABLE (entry));
g_list_free (children);
value = g_variant_parse (type, text, NULL, NULL, NULL);

View File

@ -390,7 +390,7 @@ string_modified (GtkEntry *entry, ObjectProperty *p)
GValue val = G_VALUE_INIT;
g_value_init (&val, G_TYPE_STRING);
g_value_set_static_string (&val, gtk_entry_get_text (entry));
g_value_set_static_string (&val, gtk_editable_get_text (GTK_EDITABLE (entry)));
set_property_value (p->obj, p->spec, &val);
g_value_unset (&val);
}
@ -400,7 +400,7 @@ intern_string_modified (GtkEntry *entry, ObjectProperty *p)
{
const gchar *s;
s = g_intern_string (gtk_entry_get_text (entry));
s = g_intern_string (gtk_editable_get_text (GTK_EDITABLE (entry)));
if (g_str_equal (p->spec->name, "id"))
gtk_css_node_set_id (GTK_CSS_NODE (p->obj), s);
else if (g_str_equal (p->spec->name, "name"))
@ -421,11 +421,11 @@ string_changed (GObject *object, GParamSpec *pspec, gpointer data)
str = g_value_get_string (&val);
if (str == NULL)
str = "";
text = gtk_entry_get_text (entry);
text = gtk_editable_get_text (GTK_EDITABLE (entry));
if (g_strcmp0 (str, text) != 0)
{
block_controller (G_OBJECT (entry));
gtk_entry_set_text (entry, str);
gtk_editable_set_text (GTK_EDITABLE (entry), str);
unblock_controller (G_OBJECT (entry));
}
@ -620,7 +620,7 @@ flags_changed (GObject *object, GParamSpec *pspec, gpointer data)
static gunichar
unichar_get_value (GtkEntry *entry)
{
const gchar *text = gtk_entry_get_text (entry);
const gchar *text = gtk_editable_get_text (GTK_EDITABLE (entry));
if (text[0])
return g_utf8_get_char (text);
@ -663,7 +663,7 @@ unichar_changed (GObject *object, GParamSpec *pspec, gpointer data)
buf[len] = '\0';
block_controller (G_OBJECT (entry));
gtk_entry_set_text (entry, buf);
gtk_editable_set_text (GTK_EDITABLE (entry), buf);
unblock_controller (G_OBJECT (entry));
}
}

View File

@ -66,7 +66,7 @@ add_string (GtkInspectorStrvEditor *editor,
gtk_widget_show (box);
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), str);
gtk_editable_set_text (GTK_EDITABLE (entry), str);
gtk_widget_show (entry);
gtk_container_add (GTK_CONTAINER (box), entry);
g_object_set_data (G_OBJECT (box), "entry", entry);
@ -163,7 +163,7 @@ gtk_inspector_strv_editor_get_strv (GtkInspectorStrvEditor *editor)
GtkEntry *entry;
entry = GTK_ENTRY (g_object_get_data (G_OBJECT (l->data), "entry"));
g_ptr_array_add (p, g_strdup (gtk_entry_get_text (entry)));
g_ptr_array_add (p, g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry))));
}
g_list_free (children);

View File

@ -201,7 +201,7 @@ update_font_scale (GtkInspectorVisual *vis,
{
gchar *str = g_strdup_printf ("%0.2f", factor);
gtk_entry_set_text (GTK_ENTRY (vis->priv->font_scale_entry), str);
gtk_editable_set_text (GTK_EDITABLE (vis->priv->font_scale_entry), str);
g_free (str);
}
}
@ -223,7 +223,7 @@ font_scale_entry_activated (GtkEntry *entry,
gdouble factor;
gchar *err = NULL;
factor = g_strtod (gtk_entry_get_text (entry), &err);
factor = g_strtod (gtk_editable_get_text (GTK_EDITABLE (entry)), &err);
if (err != NULL)
update_font_scale (vis, factor, TRUE, FALSE);
}
@ -714,7 +714,7 @@ update_slowdown (GtkInspectorVisual *vis,
{
gchar *str = g_strdup_printf ("%0.*f", 2, slowdown);
gtk_entry_set_text (GTK_ENTRY (vis->priv->slowdown_entry), str);
gtk_editable_set_text (GTK_EDITABLE (vis->priv->slowdown_entry), str);
g_free (str);
}
}
@ -739,7 +739,7 @@ slowdown_entry_activated (GtkEntry *entry,
gdouble slowdown;
gchar *err = NULL;
slowdown = g_strtod (gtk_entry_get_text (entry), &err);
slowdown = g_strtod (gtk_editable_get_text (GTK_EDITABLE (entry)), &err);
if (err != NULL)
update_slowdown (vis, slowdown, TRUE, FALSE);
}

View File

@ -120,7 +120,7 @@ main (int argc,
for (i = 0; i < 3; i++) {
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), "│XYyj,Ö...");
gtk_editable_set_text (GTK_EDITABLE (entry), "│XYyj,Ö...");
set_font_size (entry, i);

View File

@ -9,7 +9,7 @@ text_activated (GtkEntry *entry, gpointer data)
GdkRGBA rgba;
const char *text;
text = gtk_entry_get_text (entry);
text = gtk_editable_get_text (GTK_EDITABLE (entry));
g_signal_handlers_block_by_func (entry, rgba_changed, entry);
if (gdk_rgba_parse (&rgba, text))
@ -28,7 +28,7 @@ rgba_changed (GtkColorChooser *chooser, GParamSpec *pspec, gpointer data)
s = gdk_rgba_to_string (&color);
g_signal_handlers_block_by_func (entry, text_activated, chooser);
gtk_entry_set_text (GTK_ENTRY (entry), s);
gtk_editable_set_text (GTK_EDITABLE (entry), s);
g_signal_handlers_unblock_by_func (entry, text_activated, chooser);
g_free (s);

View File

@ -279,7 +279,7 @@ match_selected_cb (GtkEntryCompletion *completion,
entry = gtk_entry_completion_get_entry (completion);
gtk_tree_model_get (GTK_TREE_MODEL (model), iter, 1, &str, -1);
gtk_entry_set_text (GTK_ENTRY (entry), str);
gtk_editable_set_text (GTK_EDITABLE (entry), str);
gtk_editable_set_position (GTK_EDITABLE (entry), -1);
g_free (str);

View File

@ -5,7 +5,7 @@ static void
clear_pressed (GtkEntry *entry, gint icon, gpointer data)
{
if (icon == GTK_ENTRY_ICON_SECONDARY)
gtk_entry_set_text (entry, "");
gtk_editable_set_text (GTK_EDITABLE (entry), "");
}
static void
@ -180,7 +180,7 @@ main (int argc, char **argv)
entry = gtk_entry_new ();
gtk_widget_set_hexpand (entry, TRUE);
gtk_grid_attach (GTK_GRID (grid), entry, 1, 1, 1, 1);
gtk_entry_set_text (GTK_ENTRY (entry), "Right-to-left");
gtk_editable_set_text (GTK_EDITABLE (entry), "Right-to-left");
gtk_widget_set_direction (entry, GTK_TEXT_DIR_RTL);
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),

View File

@ -2353,7 +2353,7 @@ create_entry (GtkWidget *widget)
gtk_container_add (GTK_CONTAINER (box2), hbox);
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), "hello world \330\247\331\204\330\263\331\204\330\247\331\205 \330\271\331\204\331\212\331\203\331\205");
gtk_editable_set_text (GTK_EDITABLE (entry), "hello world \330\247\331\204\330\263\331\204\330\247\331\205 \330\271\331\204\331\212\331\203\331\205");
gtk_editable_select_region (GTK_EDITABLE (entry), 0, 5);
gtk_container_add (GTK_CONTAINER (hbox), entry);
@ -2372,7 +2372,7 @@ create_entry (GtkWidget *widget)
gtk_combo_box_text_append_text (cb, "item9 item9");
cb_entry = gtk_bin_get_child (GTK_BIN (cb));
gtk_entry_set_text (GTK_ENTRY (cb_entry), "hello world \n\n\n foo");
gtk_editable_set_text (GTK_EDITABLE (cb_entry), "hello world \n\n\n foo");
gtk_editable_select_region (GTK_EDITABLE (cb_entry), 0, -1);
gtk_container_add (GTK_CONTAINER (box2), GTK_WIDGET (cb));
@ -2713,8 +2713,8 @@ spin_button_time_output_func (GtkSpinButton *spin_button)
hours = gtk_adjustment_get_value (adjustment) / 60.0;
minutes = (fabs(floor (hours) - hours) < 1e-5) ? 0.0 : 30;
sprintf (buf, "%02.0f:%02.0f", floor (hours), minutes);
if (strcmp (buf, gtk_spin_button_get_text (spin_button)))
gtk_spin_button_set_text (spin_button, buf);
if (strcmp (buf, gtk_editable_get_text (GTK_EDITABLE (spin_button))))
gtk_editable_set_text (GTK_EDITABLE (spin_button), buf);
return TRUE;
}
@ -2732,7 +2732,7 @@ spin_button_month_input_func (GtkSpinButton *spin_button,
for (i = 1; i <= 12; i++)
{
tmp1 = g_ascii_strup (month[i - 1], -1);
tmp2 = g_ascii_strup (gtk_spin_button_get_text (spin_button), -1);
tmp2 = g_ascii_strup (gtk_editable_get_text (GTK_EDITABLE (spin_button)), -1);
if (strstr (tmp1, tmp2) == tmp1)
found = TRUE;
g_free (tmp1);
@ -2764,8 +2764,8 @@ spin_button_month_output_func (GtkSpinButton *spin_button)
for (i = 1; i <= 12; i++)
if (fabs (value - (double)i) < 1e-5)
{
if (strcmp (month[i-1], gtk_spin_button_get_text (spin_button)))
gtk_spin_button_set_text (spin_button, month[i-1]);
if (strcmp (month[i-1], gtk_editable_get_text (GTK_EDITABLE (spin_button))))
gtk_editable_set_text (GTK_EDITABLE (spin_button), month[i-1]);
}
return TRUE;
}
@ -2778,7 +2778,7 @@ spin_button_hex_input_func (GtkSpinButton *spin_button,
gchar *err;
gdouble res;
buf = gtk_spin_button_get_text (GTK_SPIN_BUTTON (spin_button));
buf = gtk_editable_get_text (GTK_EDITABLE (spin_button));
res = strtol(buf, &err, 16);
*new_val = res;
if (*err)
@ -2800,8 +2800,8 @@ spin_button_hex_output_func (GtkSpinButton *spin_button)
sprintf (buf, "0x00");
else
sprintf (buf, "0x%.2X", (gint) val);
if (strcmp (buf, gtk_spin_button_get_text (spin_button)))
gtk_spin_button_set_text (spin_button, buf);
if (strcmp (buf, gtk_editable_get_text (GTK_EDITABLE (spin_button))))
gtk_editable_set_text (GTK_EDITABLE (spin_button), buf);
return TRUE;
}
@ -2864,7 +2864,7 @@ create_spins (GtkWidget *widget)
G_CALLBACK (spin_button_time_output_func),
NULL);
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE);
gtk_spin_button_set_width_chars (GTK_SPIN_BUTTON (spinner), 5);
gtk_editable_set_width_chars (GTK_EDITABLE (spinner), 5);
gtk_container_add (GTK_CONTAINER (vbox2), spinner);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
@ -2889,7 +2889,7 @@ create_spins (GtkWidget *widget)
G_CALLBACK (spin_button_month_output_func),
NULL);
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE);
gtk_spin_button_set_width_chars (GTK_SPIN_BUTTON (spinner), 9);
gtk_editable_set_width_chars (GTK_EDITABLE (spinner), 9);
gtk_container_add (GTK_CONTAINER (vbox2), spinner);
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
@ -2912,7 +2912,7 @@ create_spins (GtkWidget *widget)
G_CALLBACK (spin_button_hex_output_func),
NULL);
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE);
gtk_spin_button_set_width_chars (GTK_SPIN_BUTTON (spinner), 4);
gtk_editable_set_width_chars (GTK_EDITABLE (spinner), 4);
gtk_container_add (GTK_CONTAINER (vbox2), spinner);
frame = gtk_frame_new ("Accelerated");
@ -3193,7 +3193,7 @@ cursor_pressed_cb (GtkGesture *gesture,
else
i = (i + n - 1) % n;
gtk_entry_set_text (GTK_ENTRY (entry), cursor_names[i]);
gtk_editable_set_text (GTK_EDITABLE (entry), cursor_names[i]);
}
static void
@ -3202,7 +3202,7 @@ set_cursor_from_name (GtkWidget *entry,
{
const gchar *name;
name = gtk_entry_get_text (GTK_ENTRY (entry));
name = gtk_editable_get_text (GTK_EDITABLE (entry));
gtk_widget_set_cursor_from_name (widget, name);
g_object_set_data_full (G_OBJECT (widget), "name", g_strdup (name), g_free);
@ -3227,7 +3227,7 @@ change_cursor_theme (GtkWidget *widget,
children = gtk_container_get_children (GTK_CONTAINER (data));
theme = gtk_entry_get_text (GTK_ENTRY (children->next->data));
theme = gtk_editable_get_text (GTK_EDITABLE (children->next->data));
size = (gint) gtk_spin_button_get_value (GTK_SPIN_BUTTON (children->next->next->data));
g_list_free (children);
@ -3306,7 +3306,7 @@ create_cursors (GtkWidget *widget)
gtk_container_add (GTK_CONTAINER (hbox), label);
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), "default");
gtk_editable_set_text (GTK_EDITABLE (entry), "default");
gtk_container_add (GTK_CONTAINER (hbox), entry);
size = gtk_spin_button_new_with_range (1.0, 128.0, 1.0);
@ -3372,7 +3372,7 @@ create_cursors (GtkWidget *widget)
gtk_widget_show (window);
gtk_entry_set_text (GTK_ENTRY (entry), "arrow");
gtk_editable_set_text (GTK_EDITABLE (entry), "arrow");
}
else
gtk_widget_destroy (window);
@ -3699,7 +3699,7 @@ screen_display_check (GtkWidget *widget, ScreenDisplaySelection *data)
GdkDisplay *new_display = NULL;
GdkDisplay *current_display = gtk_widget_get_display (widget);
display_name = gtk_entry_get_text (GTK_ENTRY (data->entry));
display_name = gtk_editable_get_text (GTK_EDITABLE (data->entry));
display = gdk_display_open (display_name);
if (!display)
@ -3780,8 +3780,8 @@ create_display_screen (GtkWidget *widget)
combo_dpy = gtk_combo_box_text_new_with_entry ();
gtk_widget_set_hexpand (combo_dpy, TRUE);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dpy), "diabolo:0.0");
gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo_dpy))),
"<hostname>:<X Server Num>.<Screen Num>");
gtk_editable_set_text (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (combo_dpy))),
"<hostname>:<X Server Num>.<Screen Num>");
gtk_grid_attach (GTK_GRID (grid), label_dpy, 0, 0, 1, 1);
gtk_grid_attach (GTK_GRID (grid), combo_dpy, 0, 1, 1, 1);
@ -5759,7 +5759,7 @@ static void
entry_changed (GtkWidget *widget, ProgressData *pdata)
{
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (pdata->pbar),
gtk_entry_get_text (GTK_ENTRY (pdata->entry)));
gtk_editable_get_text (GTK_EDITABLE (pdata->entry)));
}
void

View File

@ -18,7 +18,7 @@ inhibitor_toggled (GtkToggleButton *button, GtkApplication *app)
guint cookie;
active = gtk_toggle_button_get_active (button);
reason = gtk_entry_get_text (GTK_ENTRY (inhibit_entry));
reason = gtk_editable_get_text (GTK_EDITABLE (inhibit_entry));
flags = 0;
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (inhibit_logout)))

View File

@ -140,7 +140,7 @@ action_clicked_cb (GtkWidget *button,
GtkWidget *page, *title;
page = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (page), "Addition");
gtk_editable_set_text (GTK_EDITABLE (page), "Addition");
title = gtk_label_new ("Addition");
@ -174,7 +174,7 @@ create_notebook (gchar **labels,
while (*labels)
{
page = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (page), *labels);
gtk_editable_set_text (GTK_EDITABLE (page), *labels);
title = gtk_label_new (*labels);

View File

@ -34,7 +34,7 @@ main (gint argc,
gtk_widget_set_halign (revealer, GTK_ALIGN_START);
gtk_widget_set_valign (revealer, GTK_ALIGN_START);
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), "00000");
gtk_editable_set_text (GTK_EDITABLE (entry), "00000");
gtk_container_add (GTK_CONTAINER (revealer), entry);
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_NONE);
@ -47,7 +47,7 @@ main (gint argc,
gtk_widget_set_halign (revealer, GTK_ALIGN_END);
gtk_widget_set_valign (revealer, GTK_ALIGN_END);
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), "00000");
gtk_editable_set_text (GTK_EDITABLE (entry), "00000");
gtk_container_add (GTK_CONTAINER (revealer), entry);
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
@ -60,7 +60,7 @@ main (gint argc,
gtk_widget_set_hexpand (revealer, TRUE);
gtk_widget_set_halign (revealer, GTK_ALIGN_START);
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), "12345");
gtk_editable_set_text (GTK_EDITABLE (entry), "12345");
gtk_container_add (GTK_CONTAINER (revealer), entry);
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT);
@ -73,7 +73,7 @@ main (gint argc,
gtk_widget_set_vexpand (revealer, TRUE);
gtk_widget_set_valign (revealer, GTK_ALIGN_START);
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), "23456");
gtk_editable_set_text (GTK_ENTRY (entry), "23456");
gtk_container_add (GTK_CONTAINER (revealer), entry);
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
@ -86,7 +86,7 @@ main (gint argc,
gtk_widget_set_hexpand (revealer, TRUE);
gtk_widget_set_halign (revealer, GTK_ALIGN_END);
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), "34567");
gtk_editable_set_text (GTK_EDITABLE (entry), "34567");
gtk_container_add (GTK_CONTAINER (revealer), entry);
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT);
@ -99,7 +99,7 @@ main (gint argc,
gtk_widget_set_vexpand (revealer, TRUE);
gtk_widget_set_valign (revealer, GTK_ALIGN_END);
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), "45678");
gtk_editable_set_text (GTK_EDITABLE (entry), "45678");
gtk_container_add (GTK_CONTAINER (revealer), entry);
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP);

View File

@ -7,7 +7,7 @@ on_text_changed (GtkEntry *entry,
{
const gchar *layout;
layout = gtk_entry_get_text (entry);
layout = gtk_editable_get_text (GTK_EDITABLE (entry));
gtk_header_bar_set_decoration_layout (bar, layout);
}
@ -137,7 +137,7 @@ activate (GApplication *gapp)
entry = gtk_entry_new ();
g_object_get (gtk_widget_get_settings (window), "gtk-decoration-layout", &layout, NULL);
gtk_entry_set_text (GTK_ENTRY (entry), layout);
gtk_editable_set_text (GTK_EDITABLE (entry), layout);
g_free (layout);
g_signal_connect (entry, "notify::text",

View File

@ -289,7 +289,7 @@ match_file (gpointer item, gpointer data)
path = g_file_get_path (file);
result = strstr (path, gtk_entry_get_text (GTK_ENTRY (search_entry))) != NULL;
result = strstr (path, gtk_editable_get_text (GTK_EDITABLE (search_entry))) != NULL;
g_object_unref (info);
g_free (path);

View File

@ -87,14 +87,14 @@ iter_insert (GtkWidget *button, GtkTreeView *tree_view)
gtk_tree_store_insert (GTK_TREE_STORE (model),
&iter,
&selected,
atoi (gtk_entry_get_text (GTK_ENTRY (entry))));
atoi (gtk_editable_get_text (GTK_EDITABLE (entry))));
}
else
{
gtk_tree_store_insert (GTK_TREE_STORE (model),
&iter,
NULL,
atoi (gtk_entry_get_text (GTK_ENTRY (entry))));
atoi (gtk_editable_get_text (GTK_EDITABLE (entry))));
}
node_set (&iter);
@ -114,7 +114,7 @@ iter_change (GtkWidget *button, GtkTreeView *tree_view)
gtk_tree_store_set (GTK_TREE_STORE (model),
&selected,
1,
gtk_entry_get_text (GTK_ENTRY (entry)),
gtk_editable_get_text (GTK_EDITABLE (entry)),
-1);
}
}
@ -130,7 +130,7 @@ iter_insert_with_values (GtkWidget *button, GtkTreeView *tree_view)
entry = g_object_get_data (G_OBJECT (button), "user_data");
str1 = g_strdup_printf ("Row (<span color=\"red\">%d</span>)", node_count++);
str2 = g_strdup_printf ("%d", atoi (gtk_entry_get_text (GTK_ENTRY (entry))));
str2 = g_strdup_printf ("%d", atoi (gtk_editable_get_text (GTK_EDITABLE (entry))));
if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
NULL,

View File

@ -122,7 +122,7 @@ test_insert (void)
entry = gtk_entry_new ();
g_object_ref_sink (entry);
gtk_entry_set_text (GTK_ENTRY (entry), "bar");
gtk_editable_set_text (GTK_EDITABLE (entry), "bar");
gtk_editable_set_position (GTK_EDITABLE (entry), -1);
pos = gtk_editable_get_position (GTK_EDITABLE (entry));
g_assert_cmpint (pos, ==, 3);
@ -224,7 +224,7 @@ test_delete (void)
entry = gtk_entry_new ();
g_object_ref_sink (entry);
gtk_entry_set_text (GTK_ENTRY (entry), "foobar");
gtk_editable_set_text (GTK_EDITABLE (entry), "foobar");
gtk_editable_set_position (GTK_EDITABLE (entry), -1);
pos = gtk_editable_get_position (GTK_EDITABLE (entry));
g_assert_cmpint (pos, ==, 6);