From f411a0231299846466546a490ee16ba6c21bc6d6 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 21 Apr 2015 20:02:25 -0400 Subject: [PATCH] Started planning a do-over of the library. --- docs/uiButton.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/uiButton.md b/docs/uiButton.md index 4eb702cd..dd8366b3 100644 --- a/docs/uiButton.md +++ b/docs/uiButton.md @@ -30,9 +30,13 @@ Changes the text shown on the uiButton to the given text string. ## func OnClicked() ```c -void uiButtonOnClicked(uiButton *b, void (*handler)(uiButton *, void *), void *data); +void uiButtonOnClicked(uiButton *b, void (*handler)(void *sender, void *data), void *data); ``` -Sets the function that is called when the user clicks the uiButton. The `data` parameter is passed as the second argument to this function. If a handler was previous assigned, this call replaces the old handler with the given one. +Sets the function that is called when the user clicks the uiButton. If a handler was previous assigned, this call replaces the old handler with the given one. + +The `sender` argument to the callback is the `b` argument to `uiButtonOnClicked()`. It is of type `void *` to allow uiMenus to use the same callback functions. + +The `data` argument to the callback is the `data` argument to `uiButtonOnClicked()`. The default handler does nothing.