First, let’s create our ‘Delete’ button:

Go to Design View of your ‘ArticleView’ Form, and drop a FlowPanel Flow Panel icon onto the page next to the edit_article_button. Move that button into the FlowPanel then drop a second button into the FlowPanel. Set the align property of the FlowPanel to ‘right’. Resize components as needed.

Adding a FlowPanel and Button to the ArticleView Form

Select the new button, and rename it delete_article_button. Change the role to filled-button and the background property to ‘Error’. Use the trash icon in place of text to indicate that the button will delete the article.

The properties for the Delete button

The properties for the Delete button

Finally, adjust the column width if necessary to make sure both buttons are displayed properly (use Ctrl+drag / ⌘+drag for finer adjustments).

Now, let’s create an event handler for your delete button by double clicking the button in the designer.

  def delete_article_button_click(self, **event_args):
    """This method is called when the button is clicked"""
    pass