Swap layout then execute function

Hey all! Currently I am building an e-mail app and I am having some trouble with the last part.

Each window is it’s own class and then they are all stacked in a MainWindow class.

When i Click the “Send :arrow_right:” I wanted to:

  1. Swap out the layout to the SendingPage;
  2. Send the e-mails.

I am having an issue, it either does not swap and sends the e-mails, or it swaps, and doesn’t send the e-mails.