| oogui | index oogui.py |
Object-oriented version of the filegui tutorial that displays the
files in the specified directory, and displays the contents of the
file in the lower portion of the window.
OVERVIEW
========
<.> This is a simple GUI base class, intended to provide the
'interface' (abstract class) for various GUI implementations
to 'show off' some of their basic GUI constructs.
<.> Template and hook methods raise a NotImplementedError to ensure
the derived GUIs provide the minimum functionality required.
<.> A toolkit's demos, example programs are a great help resource.
'SEQUENCE' OF OPERATIONS
========================
<< libGui == the class from the GUI toolkit being used as application window >>
oogui
(module level)
+ parse command line args
+ instantiate requested GUI type
DerivedGui(OOGui, libGui)
+ initialize instance variables
+ call libGui's constructor
+ call OOGui's constructor
OOGui
+ OOGui.__init__
+ set self._topLevel
+ call template method _buildGui()
+ _setCWD(startdir)
+ call template method: _startGui()
+ show self._topLevel
+ start the main event loop
EVENT HANDLING HOOKS
====================
Derived GUI's should connect the following events (signals) to the
base class's implementation. The base class will use the implemented
hook methods to do the work.
<.> User double-clicks on a name in the Directories list
+ OOGui._directorySelected()
+ _getSelectedDirectory()
+ _setCWD(cwd)
<.> User double-clicks on a name in the Files list
+ OOGui._fileSelected(*unused)
+ _getSelectedFile()
+ _setFilename(filename)
++determines file 'type'
+ _display<FileType>(filename)
| Modules | ||||||
| ||||||
| Classes | ||||||||||||||||||
| ||||||||||||||||||
| Data | ||
| APP_HEIGHT = 500 BORDER = 10 DIRS_LABEL = 'Directories' DISPLAY_HEIGHT = 160 DISPLAY_LABEL = 'Display file: ' DISPLAY_UNAVAIL = 'Viewer Not Available for File' DISPLAY_WIDTH = 360 FILENAME_LABEL = 'Selected File' FILES_LABEL = 'Files' SASH_MIN = 100 SASH_POSITION = 200 _BINARY = ('pyc', 'exe', 'o', 'obj', 'com', 'ppt', 'doc') _FXPY = 'F' _GEOMETRY = 'g' _GUITYPES = ['T', 'W', 'Q', 'G', 'F'] _HELP = 'h' _HTML = ('htm', 'html') _IMAGES = ('gif', 'jpg', 'jpeg', 'ppm', 'bmp', 'png', 'tif', 'tiff', 'wmf', 'pbm', 'pil') _OTHEROPT = {'g': 'geometry, e.g., <width>x<height>+<x>+<y>', 'r': 'resourceFile', 's': 'startupDirectory'} _PYGTK = 'G' _PYQT = 'Q' _RESFILE = 'r' _STARTDIR = 's' _TITLE = 'Object-Oriented GUI Example' _TKINTER = 'T' _WXWIN = 'W' __file__ = r'http://www.metaslash.com/brochure/tutorial/oogui.pyc' __name__ = 'oogui' | ||