[gtk+/wip/baedert/drawing: 217/301] spinbutton: Add accessors for (max-)width-chars
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/drawing: 217/301] spinbutton: Add accessors for (max-)width-chars
- Date: Fri, 26 May 2017 10:52:12 +0000 (UTC)
commit 502d7af027bedb44c7bdef9f74776a19c9472c4b
Author: Timm Bäder <mail baedert org>
Date: Sat May 6 17:05:58 2017 +0200
spinbutton: Add accessors for (max-)width-chars
docs/reference/gtk/gtk4-sections.txt | 4 +++
gtk/gtkspinbutton.c | 45 ++++++++++++++++++++++++++++++++++
gtk/gtkspinbutton.h | 12 +++++++++
3 files changed, 61 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index a3e1023..d0021a3 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -2719,6 +2719,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
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 9dca8ae..488bca6 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");
+}
diff --git a/gtk/gtkspinbutton.h b/gtk/gtkspinbutton.h
index 5dc3b7c..b811b5f 100644
--- a/gtk/gtkspinbutton.h
+++ b/gtk/gtkspinbutton.h
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]