

The full code for this example can be found at \mbox{\hyperlink{transit_example_02_c}{Transit example 2}}.

This example shows how to implement a chain of transitions. This chain is used to start a transition just after another transition ended. Similarly to every other elementary example, we create a window, set its title, size, autodel property, and setup a callback to exit the program when finished\+:


\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}


We also add a resizable white background to use behind our animation\+:


\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}


This example will have a chain of 4 transitions, each of them applied to one button. Thus we create 4 different buttons\+:


\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}


Now we create a simple translation transition that will be started as soon as the program loads. It will be our first transition, and the other transitions will be started just after this transition ends\+:


\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}


The code displayed until now has nothing different from what you have already seen in \mbox{\hyperlink{transit_example_01_explained}{elm\+\_\+transit -\/ Basic transit usage.}}, but now comes the new part\+: instead of creating a second transition that will start later using a timer, we create the it normally, and use \mbox{\hyperlink{group__Elm__Transit_ga4e6f191c415b31c0f3a19505e144e390}{elm\+\_\+transit\+\_\+chain\+\_\+transit\+\_\+add()}} instead of elm\+\_\+transit\+\_\+go. Since we are adding it in a chain after the first transition, it will start as soon as the first transition ends\+:


\begin{DoxyCodeInclude}{0}

\end{DoxyCodeInclude}


Finally we add the 2 other transitions to the chain, and run our program. It will make one transition start after the other finish, and there is the transition chain. 