hi all, i’m wondering if is possible to add a default value for SLATE_ARGUMENT
i’ve tried modifying the macro this way but with no luck
#define SLATE_ARGUMENT_DEFAULT( ArgType, ArgName , InArgDef) \
ArgType _##ArgName; \
WidgetArgsType& ArgName( ArgType InArg = InArgDef) \
{ \
_##ArgName = InArg; \
return this->Me(); \
}
solved, there’s no need to modify the macro because the SLATE_BEGIN_ARGS() is just a macro defining a constructor so this code works:
SLATE_BEGIN_ARGS(RA_SDetailRow)
: _BackGroundColor(FColor(62, 62, 62, 255)) //assign DEFAULT VALUE for _BackGroundColor
, _InnerPadding(FMargin(2.0)) //assign DEFAULT VALUE for _InnerPadding
{}
SLATE_ARGUMENT(FColor,BackGroundColor) // BackGroundColor Argument
SLATE_ARGUMENT(FMargin, InnerPadding) // InnerPadding Argument
SLATE_END_ARGS()
1 Like