Yes, it's different on Windows and Mac. That's something to be aware of for cross-platform GUIs.
No, it's not useless!
On Windows you use "&" to underline the next character. As Derren said, in a menu, it also sets what key will trigger that item.
To display an ampersand character, you double it to "&&".
The underline used to always be visible (a long time ago). Since Windows 7 (or maybe earlier) it's hidden by default, you can show the underlined letters by activating the menu by keyboard (press Alt).
(You can also enable the underlines all the time:
https://www.groovypost.com/howto/make-w ... tcut-keys/ )
In an OptionGadget, it doesn't automatically add a hotkey. But it's still useful to indicate keyboard shortcuts (which you add manually). Microsoft Excel uses this.
If you don't want to underline anything, you can easily write a function that turns "&" to "&&" on Windows:
Code: Select all
Procedure.s GUIEscape(Text.s)
CompilerIf (#PB_Compiler_OS = #PB_OS_Windows)
ProcedureReturn (ReplaceString(Text, "&", "&&"))
CompilerElse
ProcedureReturn (Text)
CompilerEndIf
EndProcedure
If OpenWindow(0, 300, 200, 140, 110, "OptionGadgets", #PB_Window_SystemMenu)
OptionGadget(0, 30, 20, 100, 20, GUIEscape("Option 1&"))
OptionGadget(1, 30, 45, 100, 20, GUIEscape("Option 2&&"))
OptionGadget(2, 30, 70, 100, 20, GUIEscape("Option 3&&&"))
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
EDIT: Yeah, you figured it out