uses register enum for the non-enum ButtonFlag & IconFlag
replace RARRAY_PTR with RARRAY_AREF