aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gwin_widget.h
diff options
context:
space:
mode:
authorAndrew Hannam <Andrew Hannam>2016-07-10 10:42:21 +1000
committerAndrew Hannam <Andrew Hannam>2016-07-10 10:42:21 +1000
commit9ac3c368b4de8e2f38bad56262c75d3310c8814b (patch)
tree973fb9bf591398e6826a25f64e9975cc5f06a51b /src/gwin/gwin_widget.h
parented9b268d5bce5fe6d703bc785034191312782db0 (diff)
downloaduGFX-9ac3c368b4de8e2f38bad56262c75d3310c8814b.tar.gz
uGFX-9ac3c368b4de8e2f38bad56262c75d3310c8814b.tar.bz2
uGFX-9ac3c368b4de8e2f38bad56262c75d3310c8814b.zip
Add gwinPrintg() and fix null pointer handling in sprintg()
Diffstat (limited to 'src/gwin/gwin_widget.h')
-rw-r--r--src/gwin/gwin_widget.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gwin/gwin_widget.h b/src/gwin/gwin_widget.h
index ceba235b..ece98a06 100644
--- a/src/gwin/gwin_widget.h
+++ b/src/gwin/gwin_widget.h
@@ -231,6 +231,24 @@ void gwinSetText(GHandle gh, const char *text, bool_t useAlloc);
*/
const char *gwinGetText(GHandle gh);
+#if (GFX_USE_GFILE && GFILE_NEED_PRINTG && GFILE_NEED_STRINGS) || defined(__DOXYGEN__)
+ /**
+ * @brief Set the text of a widget using a printf style format.
+ * @pre GFX_USE_GFILE, GFILE_NEED_PRINTG and GFILE_NEED_STRINGS must all be TRUE
+ *
+ * @param[in] gh The widget handle
+ * @param[in] fmt The format string using a printf/g syntax. See @p vsnprintg()
+ * @param[in] ... The printg paramters.
+ *
+ * @note The widget is automatically redrawn
+ * @note Non-widgets will ignore this call.
+ * @note The memory for the text is always allocated by this function.
+ *
+ * @api
+ */
+ void gwinPrintg(GHandle gh, const char * fmt,...);
+#endif
+
/**
* @brief Check whether a handles is a widget handle or not
*