Build a dialog widget ===================== This howto describes how we like to build dialog widgets (``wx.Dialog``). To get started, we have a tool that can generate boilerplate code. Let's try it:: python tools/dialog_template.py If we enter the name ``TestDialog``, the following files will be created for us:: source/timelinelib/wxgui/dialogs/testdialog/__init__.py source/timelinelib/wxgui/dialogs/testdialog/testdialog.py source/timelinelib/wxgui/dialogs/testdialog/testdialogcontroller.py test/specs/wxgui/dialogs/testdialog/__init__.py test/specs/wxgui/dialogs/testdialog/testdialog.py Essentially, a dialog consists of 3 files: the dialog itself, the controller, and the test file. The dialog and the controller collaborate in a pattern inspired by the `Humbe Dialog Box `_. The dialog corresponds to the view and the controller corresponds to the smart object. What the boiler plate code has given us is a way to test our dialog. Let's try the following command:: python tools/execute-specs.py --halt-gui --only testdialog A dialog shows up with a hello world button. The ``--halt-gui`` flag ensures that the dialog stays open until we manually close it. That is not desirable when running tests automatically because it needs manual inspection, but for quickly inspecting our dialog, it's perfect. Let's try without the ``--halt-gui`` flag just to ensure that it works:: python tools/execute-specs.py --only testdialog Now let's look at how the GUI elements are created. Here is ``source/timelinelib/wxgui/dialogs/testdialog/testdialog.py`` without the copyright notice:: from timelinelib.wxgui.dialogs.testdialog.testdialogcontroller import TestDialogController from timelinelib.wxgui.framework import Dialog class TestDialog(Dialog): """