GA_Underscore in CheckBox objects

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

GA_Underscore in CheckBox objects

Post by mritter0 »

I don't want any shortcut keys for my gadgets, so I put GA_Underscore,0, in all the buttons gadgets. I do so because the text changes in the button gadgets and may have an _ in the text occasionally.

When I do GA_Underscore,0, for CheckBox objects I get a bunch of garbage text appended to the end of the text. See attached image.

It works fine for everything else.
Attachments
CheckBox.png
Workbench Explorer - A better way to browse drawers
User avatar
Daedalus
Posts: 42
Joined: Sat Jun 18, 2011 12:30 am
Location: From Ireland, living in Glasgow
Contact:

Re: GA_Underscore in CheckBox objects

Post by Daedalus »

Hmmm, sounds like using null might do funny things since the labels are probably all null-terminated strings, so all contain a null character that some code somewhere mistakenly decides needs to be underlined. That's what your screenshot looks like anyway - the null at the end of your label is swallowed and the garbage is whatever is in memory after the end of your string.

As a workaround, can you set it to a character that isn't used in any of your strings? Like "%", or maybe even a non-printable character.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: GA_Underscore in CheckBox objects

Post by broadblues »

try using ~0 not 0
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Re: GA_Underscore in CheckBox objects

Post by mritter0 »

~0 works. Maybe a note should be made of that in the autodocs......?

Thanks
Workbench Explorer - A better way to browse drawers
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 530
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: GA_Underscore in CheckBox objects

Post by salass00 »

mritter0 wrote: When I do GA_Underscore,0, for CheckBox objects I get a bunch of garbage text appended to the end of the text. See attached image.
The reason is as others have already stated that it tries to underscore the NUL-terminator character.

This bug should be fixed in checkbox.gadget 53.10.
Post Reply