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
|
..
NOTE: This RST file was generated by `make examples`.
Do not edit it directly.
See docs/source/examples/example_doc_generator.py
Focus Traversal Example
===============================================================================
An example of using the FocusTraversal advanced widget feature.
The FocusTraversal is an advanced widget feature for controlling the
order in which widgets receive focus during Tab and Shift+Tab keyboard
events. It enables two methods which can be implemented as declarative
Enaml functions which will compute the next/previous focus widgets on
demand.
In this example, the traversal handlers simply return the next or
previous field from a double-linked list of fields. However, there
is no restriction on how the handlers actually compute the focus
widgets.
.. TIP:: To see this example in action, download it from
:download:`focus_traversal <../../../examples/widgets/focus_traversal.enaml>`
and run::
$ enaml-run focus_traversal.enaml
Screenshot
-------------------------------------------------------------------------------
.. image:: images/ex_focus_traversal.png
Example Enaml Code
-------------------------------------------------------------------------------
.. literalinclude:: ../../../examples/widgets/focus_traversal.enaml
:language: enaml
|