--- a/gntbutton.h Sat Apr 06 06:05:21 2019 -0400
+++ b/gntbutton.h Sat Apr 06 16:32:41 2019 -0400
@@ -86,6 +86,29 @@
GntWidget * gnt_button_new(const char *text);
+ * @text: The text for the button. + * Set the text of a button. +void gnt_button_set_text(GntButton *button, const gchar *text); + * Get the text of a button. + * Returns: The text for the button. +const gchar *gnt_button_get_text(GntButton *button); #endif /* GNT_BUTTON_H */
--- a/gntcheckbox.c Sat Apr 06 06:05:21 2019 -0400
+++ b/gntcheckbox.c Sat Apr 06 16:32:41 2019 -0400
@@ -51,7 +51,8 @@
mvwaddch(widget->window, 0, 2, ']');
wbkgdset(widget->window, '\0' | gnt_color_pair(GNT_COLOR_NORMAL));
- mvwaddstr(widget->window, 0, 4, C_(GNT_BUTTON(cb)->priv->text));
+ mvwaddstr(widget->window, 0, 4, + C_(gnt_button_get_text(GNT_BUTTON(cb)))); (void)wmove(widget->window, 0, 1);
@@ -156,7 +157,7 @@
GntWidget *widget = g_object_new(GNT_TYPE_CHECK_BOX, NULL);
- GNT_BUTTON(widget)->priv->text = g_strdup(text);
+ gnt_button_set_text(GNT_BUTTON(widget), text); gnt_widget_set_take_focus(widget, TRUE);