Page 1 of 1

Getting a literal tilda (~) in menu item text

PostPosted: Fri Oct 17, 2014 11:01 am
by kwalcock
Including a tilda (~) in menu item text will create a handy shortcut, but how can I get a plain, literal tilda character? I can find no documentation about how to "escape" the special character. None of ~~, '~, \~ work. The tildas are all removed. It works for the undo and redo menu items, so there must be a secret way. Who knows it?

Re: Getting a literal tilda (~) in menu item text

PostPosted: Sat Oct 18, 2014 3:40 am
by kingfisher
Code to set a tilde to a cell is quite simple. Exactly what do you mean ? Are you trying to add a menu item with Tools > Customise ?

Re: Getting a literal tilda (~) in menu item text

PostPosted: Sat Oct 18, 2014 8:41 am
by kwalcock
I wouldn't say there was a cell involved. This is a custom menu and menu items for an addon. Showing that it can be done from Addons.xcu would be a first step. Because I change the menu item text on the fly, I change the menu item text using FeatureStateEvent.State. The changed text may have its own tildas in addition to the tilda that is used for the shortcut. For example, the text could end up being "~Undo: Typing: 'he~llo'". I see that OpenOffice gets it wrong on Windows. This particular tilda in 'he~llo' does not show up correctly.