Next / Previous / Contents / TCC Help System / NM Tech homepage

7. class NavLink: Describes one navigational feature

Most navigational links have three attributes:

There are two principal design complications for navigational links:

So, here's the interface to the NavLink object that represents one navigational link.

tccpage.py
# - - - - -   c l a s s   N a v L i n k   - - - - -

class NavLink:
    """Represents one navigational feature with zero or more destinations.

      Exports:
        NavLink ( shortName, destList=None, noTop=0 ):
          [ (shortName is the short name of this feature) and
            (destList is a list of (title, url) tuples representing
            places this link should point, defaulting to none) and
            (noTop is true iff this feature should be omitted from
            the top nav bar) ->
              return a new NavLink object representing those values
              ]
        .shortName:     [ as passed to constructor, read-only ]
        .destList:      [ as passed to constructor, read-only ]
        .noTop:         [ as passed to constructor, read-only ]
    """
    def __init__ ( self, shortName, destList=None, noTop=0 ):
        """Constructor for NavLink."""
        self.shortName  =  shortName
        self.destList   =  destList
        self.noTop      =  noTop