From 7e3bf8999d40e8add5ea530c93fd4c8f59850aaa Mon Sep 17 00:00:00 2001
From: David Maciejak <david.maciejak@gmail.com>
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.
---
 WINGs/WINGs/WINGs.h | 2 ++
 WINGs/wbutton.c     | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/WINGs/WINGs/WINGs.h b/WINGs/WINGs/WINGs.h
index 037f276..48ffa42 100644
--- a/WINGs/WINGs/WINGs.h
+++ b/WINGs/WINGs/WINGs.h
@@ -1069,6 +1069,8 @@ void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
 
 void WMSetButtonText(WMButton *bPtr, const char *text);
 
+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 341bdc8..33a9095 100644
--- a/WINGs/wbutton.c
+++ b/WINGs/wbutton.c
@@ -325,6 +325,11 @@ void WMSetButtonText(WMButton * bPtr, const char *text)
 	}
 }
 
+char *WMGetButtonText(WMButton *bPtr)
+{
+	return bPtr->caption;
+}
+
 void WMSetButtonAltText(WMButton * bPtr, const char *text)
 {
 	if (bPtr->altCaption)
-- 
2.1.0

