• R/O
  • SSH

tkpane: Commit

Default repository for tkpane.py.


Commit MetaInfo

Revisãoc8211341ec1a5e69faa7a268fad407eeb9f3f486 (tree)
Hora2018-07-21 11:14:45
AutorDreas Nielsen <dreas.nielsen@gmai...>
CommiterDreas Nielsen

Mensagem de Log

Documentation edits.

Mudança Sumário

Diff

diff -r 9b69ee66c067 -r c8211341ec1a doc/source/conf.py
--- a/doc/source/conf.py Sat Mar 17 10:19:15 2018 -0700
+++ b/doc/source/conf.py Fri Jul 20 19:14:45 2018 -0700
@@ -96,7 +96,9 @@
9696 # further. For a list of options available for each theme, see the
9797 # documentation.
9898 #
99-# html_theme_options = {}
99+html_theme_options = {
100+ 'collapse_navigation': False
101+}
100102
101103 # Add any paths that contain custom static files (such as style sheets) here,
102104 # relative to this directory. They are copied after the builtin static files,
diff -r 9b69ee66c067 -r c8211341ec1a doc/source/index.rst
--- a/doc/source/index.rst Sat Mar 17 10:19:15 2018 -0700
+++ b/doc/source/index.rst Fri Jul 20 19:14:45 2018 -0700
@@ -41,7 +41,7 @@
4141 button pane to reference any other panes to obtain their data.
4242
4343 .. toctree::
44- :maxdepth: 3
44+ :maxdepth: 4
4545 :caption: Contents:
4646
4747
@@ -226,6 +226,7 @@
226226 user; other keys and values are added to the EntryPane object's data
227227 dictionary.
228228
229+.. _callback_lists:
229230
230231 Callback Lists
231232 -------------------------------------------------------------
@@ -286,6 +287,7 @@
286287 ``CbHandler`` objects.
287288
288289
290+.. _usage:
289291
290292 Usage
291293 ==============================================================
@@ -303,29 +305,42 @@
303305 The general pattern for use of the ``tkpane`` package is:
304306
305307 1. Create any custom pane classes needed, or use those from ``tkpane.lib``.
308+ See :ref:`Example 2<example2>` for an illustration of the creation
309+ of a custom pane class.
306310 2. Create the layout of the application (or of an application window),
307- defining a Tkinter frame or notebook page to hold each pane.
311+ defining a Tkinter frame or notebook page to hold each pane. See
312+ :ref:`Example 1<example1>` and :ref:`Example 3<example3>` for
313+ illustrations of creation of a layout that includes a frame for
314+ every pane that is to be used.
308315 3. Instantiate a pane object for each enclosing frame by passing the
309316 enclosing frame widget to the pane class's constructor method.
310317 4. If needed, use the ``requires()`` method to identify which frames
311- depend on valid data from other frames.
318+ depend on valid data from other frames. See, for example, lines
319+ 57 and 58 of :ref:`Example 1<example1>`, and lines 116 and 117
320+ of :ref:`Example 3<example3>`.
312321 5. If needed, use the ``requires_datavalue()`` method to indicate that
313322 the pane must have a specific key and value in its data dictionary
314323 for it to enable itself.
315324 6. If needed, use the ``can_use()`` method to indicate that one pane
316325 will accept another pane's data, but does not require it.
317-7. If needed, append any additional required callback handler objects
318- to the pane's callback lists.
326+7. If needed, append any additional required callback functions,
327+ encapsulated in callback handler objects, to the pane's
328+ :ref:`callback lists<callback_lists>`. See, for example, lines 121
329+ and 122 of :ref:`Example 3<example3>`.
319330 8. If desired, set the status and progress reporting objects for
320331 individual panes, assigning appropriate pane objects to the
321332 ``status_reporter`` and ``progress_reporter`` attributes of the
322- ``TkPane`` subclass object.
333+ ``TkPane`` subclass object. See, for example, lines 66 and 67 of
334+ :ref:`Example 1<example1>`.
323335 9. If needed, perform any additional pane-specific or application-specific
324- configuration or initialization.
336+ configuration or initialization. See, for example, line 71 of
337+ :ref:`Example 1<example1>` and lines 126 and 127 of
338+ :ref:`Example 3<example3>`.
325339 10. If needed, initialize the appearance and data sharing of the UI by
326340 calling the ``tkpane.run_validity_callbacks()`` and
327341 ``tkpane.enable_or_disable_all()`` functions, passing each a list of
328- panes as an argument.
342+ panes as an argument. See, for example, line 62 of
343+ :ref:`Example 1<example1>`.
329344
330345
331346
@@ -792,6 +807,7 @@
792807 arrangement of the panes into an overall application UI.
793808
794809 .. code-block:: python
810+ :linenos:
795811
796812 try:
797813 import Tkinter as tk
@@ -918,6 +934,7 @@
918934 ``tkpane.lib``.
919935
920936 .. code-block:: python
937+ :linenos:
921938
922939 class EntryPane(tkpane.TkPane):
923940 def __init__(self, parent, pane_name, prompt, key_name=None):
@@ -1118,6 +1135,7 @@
11181135 ``enable_on_other_exit_only`` argument of the ``requires()`` method.
11191136
11201137 .. code-block:: python
1138+ :linenos:
11211139
11221140 import csv
11231141 import sqlite3
@@ -1234,18 +1252,18 @@
12341252 })
12351253
12361254 # Set dependencies among panes.
1237- panes.headerlist.requires(panes.infile_pane)
1238- panes.table.requires(panes.headerlist, enable_on_other_exit_only=True, clear_on_disable=True)
1255+ panes["headerlist"].requires(panes["infile_pane"])
1256+ panes["table"].requires(panes["headerlist"], enable_on_other_exit_only=True, clear_on_disable=True)
12391257
12401258 #-------------- Controller -----------------
12411259 # Set custom callbacks to populate the listbox and table display.
1242- panes.headerlist.on_enable.append(tkpane.PaneAllDataHandler(set_listbox_contents))
1243- panes.table.on_enable.append(tkpane.PaneAllDataHandler(populate_table))
1260+ panes["headerlist"].on_enable.append(tkpane.PaneAllDataHandler(set_listbox_contents))
1261+ panes["table"].on_enable.append(tkpane.PaneAllDataHandler(populate_table))
12441262
12451263 # Give the shared variable context to the listbox and table panes
12461264 # so they (their controller functions) can access the data (model).
1247- panes.headerlist.set_data(sharedvars)
1248- panes.table.set_data(sharedvars)
1265+ panes["headerlist"].set_data(sharedvars)
1266+ panes["table"].set_data(sharedvars)
12491267
12501268 #-------------- Run -----------------
12511269 root.mainloop()
Show on old repository browser