summaryrefslogtreecommitdiff
path: root/gtk/gtkspinbutton.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2017-05-06 17:05:58 +0200
committerMatthias Clasen <mclasen@redhat.com>2017-07-19 21:27:12 -0400
commit9ab43dfe9e58b669fed76483aa7ecde51655c37c (patch)
tree797314a4a75c8d78bccc4a26af6c139784d085cd /gtk/gtkspinbutton.c
parent6aa9ca7b55fff6202a7f186c8c2d165504c2afe0 (diff)
downloadgtk+-9ab43dfe9e58b669fed76483aa7ecde51655c37c.tar.gz
spinbutton: Add accessors for (max-)width-chars
Diffstat (limited to 'gtk/gtkspinbutton.c')
-rw-r--r--gtk/gtkspinbutton.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 9dca8ae7f1..488bca623c 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -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");
+}