This patch is adding a new function WMGetButtonText to get the button caption.

PS: I need that function for the upcoming patch regarding workspace switching

---
 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)
--

Attachment: 0001-WINGs-add-function-to-get-button-caption.patch
Description: Binary data

Reply via email to