Author Topic: Syntax for using Ampersand (&) in labels, etc. Ver 16.01 Linux.  (Read 3945 times)

Offline Aaron

  • Multiple posting newcomer
  • *
  • Posts: 59
Does anyone know the required syntax for using the '&' character in labels, etc?

Placing one '&' in a label produces a space, two '&' characters produce an underscore.

I did search the manual & forums for this answer.
« Last Edit: April 13, 2017, 12:56:33 am by Aaron »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Syntax for using Ampersand (&) in labels, etc.
« Reply #1 on: April 12, 2017, 08:15:16 pm »
What labels? wx, qt, win32, something else?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Aaron

  • Multiple posting newcomer
  • *
  • Posts: 59
Re: Syntax for using Ampersand (&) in labels, etc.
« Reply #2 on: April 12, 2017, 08:28:57 pm »
For wxStaticText and wxButtons.

Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: Syntax for using Ampersand (&) in labels, etc.
« Reply #3 on: April 12, 2017, 11:34:27 pm »
Looks like wxWidgets coding issues, not Codeblocks fault.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Syntax for using Ampersand (&) in labels, etc. Ver 16.01 Linux.
« Reply #4 on: April 14, 2017, 05:26:01 pm »
http://docs.wxwidgets.org/3.0/classwx_menu_item.html

Quote
The label string for the normal menu items (not separators) may include the accelerator which can be used to activate the menu item from keyboard. An accelerator key can be specified using the ampersand & character. In order to embed an ampersand character in the menu item text, the ampersand must be doubled.