How do I make a special node out of the command \innblock?
\documentclass[tikz,border=5]{standalone}
\makeatletter
\newcommand\getwidthofnode[2]{%
\pgfextractx{#1}{\pgfpointanchor{#2}{east}}%
\pgfextractx{\pgf@xa}{\pgfpointanchor{#2}{west}}% \pgf@xa is a length defined by PGF for temporary storage. No need to create a new temporary length.
\addtolength{#1}{-\pgf@xa}%
}
\makeatother
\newlength\IBheaderheight \setlength\IBheaderheight{1cm}
\newlength\IBwidth \setlength\IBwidth{8cm}
\newlength\IBheight \setlength\IBheight{6cm}
\newlength\blockroundedcorners\setlength\blockroundedcorners{0.5cm}
\newlength\blocklinewidth\setlength\blocklinewidth{3mm}
\colorlet{blocktitlebgcolor}{red}
\colorlet{blockbodybgcolor}{white}
\newcommand{\innblock}[4]{
\node[minimum size=\IBheight, minimum width=\IBwidth] (IBnode) at (#1,#2) {};
\begin{scope}[line width=\blocklinewidth, rounded corners=\blockroundedcorners, color=blocktitlebgcolor]
\draw[fill=blocktitlebgcolor] (IBnode.north west) rectangle (IBnode.south east);
\draw[fill=blockbodybgcolor] ([shift={(0,-\IBheaderheight)}]IBnode.north west) rectangle (IBnode.south east);
\newlength\mywidth\getwidthofnode{\mywidth}{IBnode}
\node[below right=\blocklinewidth, align=left, text=black, text width=\mywidth-3\blocklinewidth] at ([shift={(0,-\IBheaderheight)}]IBnode.north west) {#4};
\node[align=center, text=white, text width=\mywidth-3\blocklinewidth] at ([shift={(0,-0.5\IBheaderheight)}]IBnode.north) {#3};
\end{scope}
}
\begin{document}
\begin{tikzpicture}
\innblock{2}{1}{Header}{Body} % instead of this, I would like to have:
% \node[innblock = Header ] at (2,1) {Body};
\end{tikzpicture}
\end{document}
I considered Use node text as argument for a macro but was not able to get it done.




