File: ex_task_dialog.rst

package info (click to toggle)
python-enaml 0.19.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,284 kB
  • sloc: python: 31,443; cpp: 4,499; makefile: 140; javascript: 68; lisp: 53; sh: 20
file content (44 lines) | stat: -rw-r--r-- 1,673 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
..
  NOTE: This RST file was generated by `make examples`.
  Do not edit it directly.
  See docs/source/examples/example_doc_generator.py

Task Dialog Example
===============================================================================

An example of using the Enaml stdlib task dialog components.

The ``task_dialog`` stdlib module provides a set of components which can be
easily assembled for a dialog which follows the style of the Windows 7/8
task dialogs.

A task dialog is assembled by declaring a ``TaskDialogBody`` element as the
child of a ``Dialog``. Within the body, the various special dialog area
containers can be declared to add content to the dialog. The dialog body
takes care of automatically laying the various areas.

This example creates a Dialog which uses all of the task dialog areas,
which is not a requirement for user code. In fact, all of the areas are
optional, and the developer is free to choose the bits needed for the
task at hand.

Creating a task dialog from scratch using the area elements is flexible,
but can be a bit tedious. For the more common use cases, Enaml provides
some predefined task dialogs. See `message_box.enaml` for an example.

.. TIP:: To see this example in action, download it from
 :download:`task_dialog <../../../examples/stdlib/task_dialog.enaml>`
 and run::

   $ enaml-run task_dialog.enaml


Screenshot
-------------------------------------------------------------------------------

.. image:: images/ex_task_dialog.png

Example Enaml Code
-------------------------------------------------------------------------------
.. literalinclude:: ../../../examples/stdlib/task_dialog.enaml
    :language: enaml