Commit 9ab43dfe authored by Timm Bäder's avatar Timm Bäder 🤔 Committed by Matthias Clasen
Browse files

spinbutton: Add accessors for (max-)width-chars

parent 6aa9ca7b
......@@ -2741,6 +2741,10 @@ 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
......
......@@ -2305,3 +2305,48 @@ gtk_spin_button_set_text (GtkSpinButton *spin_button,
g_object_notify (G_OBJECT (spin_button), "text");
}
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_entry_get_width_chars (GTK_ENTRY (priv->entry));
}
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_entry_set_max_width_chars (GTK_ENTRY (priv->entry), max_width_chars);
g_object_notify (G_OBJECT (spin_button), "max-width-chars");
}
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_entry_get_width_chars (GTK_ENTRY (priv->entry));
}
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_entry_set_width_chars (GTK_ENTRY (priv->entry), width_chars);
g_object_notify (G_OBJECT (spin_button), "width-chars");
}
......@@ -232,6 +232,18 @@ const char * gtk_spin_button_get_text (GtkSpinButton *spin_button);
GDK_AVAILABLE_IN_3_92
void gtk_spin_button_set_text (GtkSpinButton *spin_button,
const char *text);
GDK_AVAILABLE_IN_3_92
int gtk_spin_button_get_max_width_chars (GtkSpinButton *spin_button);
GDK_AVAILABLE_IN_3_92
void gtk_spin_button_set_max_width_chars (GtkSpinButton *spin_button,
int max_width_chars);
GDK_AVAILABLE_IN_3_92
int gtk_spin_button_get_width_chars (GtkSpinButton *spin_button);
GDK_AVAILABLE_IN_3_92
void gtk_spin_button_set_width_chars (GtkSpinButton *spin_button,
int width_chars);
G_END_DECLS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment