Page 1 of 1

XXX_SoftStyle for all gadgets

Posted: Sun Jan 15, 2017 9:53 pm
by mritter0
Why is there not the option to set the SoftStyle for ALL gadget types? I want to set the style for CheckBoxClass buttons:

Code: Select all

LAYOUT_AddChild,			ChildObjects[GAD_APPEARANCE_DEVICES_BOLD]=IIntuition->NewObject(CheckBoxClass,NULL,
    GA_ID,						GAD_APPEARANCE_DEVICES_BOLD,
    GA_Underscore,				~0,
    GA_RelVerify,				TRUE,
    GA_Text,					SAK_LocaleString(MSG_APPEARANCE_BOLD),
    GA_Selected,				Prefs->DevicesBold,
    CHECKBOX_SoftStyle,               FSF_BOLD,
TAG_DONE),

Re: XXX_SoftStyle for all gadgets

Posted: Tue Jan 17, 2017 1:00 am
by chris
Try GA_TextAttr.
You can get the screen's TextAttr from the Screen structure or (better) using GetScreenAttr. Copy and modify ta_Style to add FSF_BOLD, and pass this.
It's not quite as easy, but it should work for all gadgetclass subclasses.

Another option is to create the string using label.image and pass it as a GA_Image. Creating labels like this is more flexible than the simple text processing most gadgets are lumbered with, the downside is they can't reformat them as they can with text, so sometimes they need a bit of extra care.