Page 1 of 1
Add an optional alt text tag to ButtonImageGadget
Posted: Thu Oct 22, 2020 3:10 pm
by Ty1003
Hello,
ButtonImageGadgets are not currently accessible to screen readers, as would be expected, as they simply have images, which screen readers can't read.
It would be great if an optional parameter could be added to them, Text, similar to ButtonGadget's text, so I could tell what the buttons were, if the developer provided a Text tag.
Example:
ButtonImageGadget(0,10,30,100,120,#MyImage,"OK")
I'm not sure how visually pleasing this would look, or if the buttons is even an okay size, as I am blind, but it would be great to see!
Re: Add an optional alt text tag to ButtonImageGadget
Posted: Thu Oct 22, 2020 4:34 pm
by Little John
Help for GadgetToolTip() wrote:Syntax
GadgetToolTip(#Gadget, Text$)
Description
Associate the specified Text$ with the #Gadget.
Did you try adding text to a ButtonImageGadget with GadgetToolTip()?
Can the sreen reader read that text properly?
Re: Add an optional alt text tag to ButtonImageGadget
Posted: Thu Oct 22, 2020 4:41 pm
by Ty1003
Hi.
From what I've seen, gadget tooltips can read, if the setting is turned on. So this does work, however, I doubt many people will put one...

Re: Add an optional alt text tag to ButtonImageGadget
Posted: Mon Oct 26, 2020 8:54 am
by nsstudios
+1
This is especially important because of ide, where certain things like profiler use image buttons and all you hear is "button", "button", "button", and have no idea what's what.
Tested GadgetTooltip with two screen readers that are used the most, and neither of them reads tooltips, and even if they did, this should not be relied upon, because many people disable reading of the same because of the often needless extra verbosity.
Code: Select all
OpenWindow(0, 0, 0, 500, 500, "test", #PB_Window_ScreenCentered|#PB_Window_Maximize)
CreateImage(0, 32, 32)
ButtonImageGadget(0, 0, 0, 32, 32, ImageID(0))
GadgetToolTip(0, "test123")
Repeat: Until WaitWindowEvent()=#PB_Event_CloseWindow
Re: Add an optional alt text tag to ButtonImageGadget
Posted: Mon Oct 26, 2020 7:00 pm
by Little John
nsstudios wrote:This is especially important because of ide, where certain things like profiler use image buttons and all you hear is "button", "button", "button", and have no idea what's what.
Uuhm ... that sounds crazy.
nsstudios wrote:Tested GadgetTooltip with two screen readers that are used the most, and neither of them reads tooltips, and even if they did, this should not be relied upon, because many people disable reading of the same because of the often needless extra verbosity.
Good to know. Thanks for the information.
Re: Add an optional alt text tag to ButtonImageGadget
Posted: Mon Oct 26, 2020 10:33 pm
by DoubleDutch
Is there a mechanism in Windows to actually do this though (apart from tootips)?
Re: Add an optional alt text tag to ButtonImageGadget
Posted: Mon Oct 26, 2020 10:54 pm
by nsstudios
I'm not really sure, but doing a quick Google search on button with both an image and text yealds:
The appearance of text or an icon or both on a button control depends on the BS_ICON and BS_BITMAP styles, and whether the
BM_SETIMAGE
message is sent. The possible results are as follows.
BS_ICON or BS_BITMAP set? | BM_SETIMAGE called? | Result
--------------------------+---------------------+--------------------
Yes | Yes | Show icon only.
No | Yes | Show icon and text.
Yes | No | Show text only.
No | No | Show text only
In other words: Don't set the BS_ICON or BS_BITMAP style (but do set the BS_TEXT style), and send a BM_SETIMAGE message once the button has been created.
https://stackoverflow.com/questions/479 ... ext-button