From 870a73ff324d9a7a0431b8ec1f4666686dadd36a Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Fri, 26 Sep 2014 11:20:25 +0700 Subject: [PATCH] WINGs: add function to get button caption This patch is adding a new function WMGetButtonText to get the button caption. Signed-off-by: Carlos R. Mafra --- WINGs/WINGs/WINGs.h | 3 +++ WINGs/wbutton.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/WINGs/WINGs/WINGs.h b/WINGs/WINGs/WINGs.h index 037f2762..e460ef43 100644 --- a/WINGs/WINGs/WINGs.h +++ b/WINGs/WINGs/WINGs.h @@ -1069,6 +1069,9 @@ void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment); void WMSetButtonText(WMButton *bPtr, const char *text); +/* Returns direct pointer to internal data, do not modify! */ +const char *WMGetButtonText(WMButton *bPtr); + void WMSetButtonAltText(WMButton *bPtr, const char *text); void WMSetButtonTextColor(WMButton *bPtr, WMColor *color); diff --git a/WINGs/wbutton.c b/WINGs/wbutton.c index 341bdc8f..c217edd4 100644 --- a/WINGs/wbutton.c +++ b/WINGs/wbutton.c @@ -325,6 +325,11 @@ void WMSetButtonText(WMButton * bPtr, const char *text) } } +const char *WMGetButtonText(WMButton *bPtr) +{ + return bPtr->caption; +} + void WMSetButtonAltText(WMButton * bPtr, const char *text) { if (bPtr->altCaption)