[yast-devel] How to show a literal '&' in an UI string?
![](https://seccdn.libravatar.org/avatar/ba6138f793e72be6644854fdc3ec2f02.jpg?s=120&d=mm&r=g)
Hello, I like to display a literal '&' in a UI dialog string like: ---------------------------------------------------------------- `InputField( `id(`options), _("Options (option1=value1&option2=value2)"), "" ) ---------------------------------------------------------------- but neither "Options (option1=value1\&option2=value2)" nor "Options (option1=value1\046option2=value2)" works for me. When I run the module with yast2 --gt module and with yast2 --qt module the text which is shown in the dialog is always Options (option1=value1option2=value2) i.e. the '&' character is omitted. Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany AG Nuernberg, HRB 16746, GF: Markus Rex -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/65c88e7b3e37715cef1884acf1cf2523.jpg?s=120&d=mm&r=g)
Hi, Johannes,
I like to display a literal '&' in a UI dialog string like: ---------------------------------------------------------------- `InputField( `id(`options), _("Options (option1=value1&option2=value2)"),
Try doubling the & char. The above would then become: "Options (option1=value1&&option2=value2)" Alas, it works only in Qt :( Gtk shows underscore and ncurses shows both &&'s Conclusion: we can't do it now (at least not in widgets supporting activation by hotkey). I'm sorry I can't give you more positive answer. fB. -- \\\\\ Katarina Machalkova \\\\\\\__o YaST developer __\\\\\\\'/_ & hedgehog painter -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/ba6138f793e72be6644854fdc3ec2f02.jpg?s=120&d=mm&r=g)
Hello Katarina, On Nov 13 17:16 Katarina Machalkova wrote (shortened):
Hi, Johannes,
I like to display a literal '&' in a UI dialog string like: ---------------------------------------------------------------- `InputField( `id(`options), _("Options (option1=value1&option2=value2)"),
Try doubling the & char. The above would then become: "Options (option1=value1&&option2=value2)"
Alas, it works only in Qt :( Gtk shows underscore and ncurses shows both &&'s
Conclusion: we can't do it now (at least not in widgets supporting activation by hotkey). I'm sorry I can't give you more positive answer.
Your answer is perfectly o.k. because a straightforward "impossible" saves a lot of time with useless trial and error attempts. I already had changed my text to avoid the literal '&' but nevertheless I was interested how to do it. For my understanding: Am I right that escaping like '\&' or encoding like '\046' cannot work here because what the hotkey stuff gets is the result of escaping and encoding i.e. the hotkey stuff gets already a literal '&' (a byte with octal value 046) so that this character can no longer be used otherwise? Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany AG Nuernberg, HRB 16746, GF: Markus Rex -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (2)
-
Johannes Meixner
-
Katarina Machalkova