aboutsummaryrefslogtreecommitdiffstats
path: root/include/gwin/gwidget.h
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-06-24 22:58:37 +1000
committerinmarket <andrewh@inmarket.com.au>2013-06-24 22:58:37 +1000
commit8ed9e763c0f97f2946990a911bb940f8c80ff761 (patch)
tree5f6c19677a530ddfada345242bce1190e3797dfa /include/gwin/gwidget.h
parentc8300fe9c2c7facff1ad32978a5d961690473de4 (diff)
downloaduGFX-8ed9e763c0f97f2946990a911bb940f8c80ff761.tar.gz
uGFX-8ed9e763c0f97f2946990a911bb940f8c80ff761.tar.bz2
uGFX-8ed9e763c0f97f2946990a911bb940f8c80ff761.zip
GWIN reduce Initialisation parameters and fix visibility issues
Diffstat (limited to 'include/gwin/gwidget.h')
-rw-r--r--include/gwin/gwidget.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/gwin/gwidget.h b/include/gwin/gwidget.h
index 0c47dfde..50f19193 100644
--- a/include/gwin/gwidget.h
+++ b/include/gwin/gwidget.h
@@ -53,6 +53,22 @@ typedef struct GWidgetObject {
/* @} */
/**
+ * @brief The structure to initialise a widget.
+ *
+ * @note Some widgets may have extra parameters.
+ * @note The text element must be static string (not stack allocated). If you want to use
+ * a dynamic string (eg a stack allocated string) use NULL for this member and then call
+ * @p gwinSetText() with useAlloc set to TRUE.
+ *
+ * @{
+ */
+typedef struct GWidgetInit {
+ GWindowInit g; // @< The GWIN initializer
+ const char * text; // @< The initial text
+} GWidgetInit;
+/* @} */
+
+/**
* A comment/rant on the above structure:
* We would really like the GWindowObject member to be anonymous. While this is
* allowed under the C11, C99, GNU and various other standards which have been