def init ( self, info ):

        # Iterate through our sub-handlers, and for each method whose name is
        # of the form 'object_name_changed', where 'object' is the name of an
        # object in the UI's context, create a trait notification handler that
        # will call the method whenever object's 'name' trait changes.
        logger.debug( 'Initializing delegation in DelegatingHandler [%s]',
                      self )
        context = info.ui.context
        for h in self.sub_handlers:
            # fixme: I don't know why this wasn't here before... I'm not
            # sure this is right!
            h.init( info )

            for name in self._each_trait_method( h ):
                if name[-8:] == '_changed':
                    prefix = name[:-8]
                    col = prefix.find( '_', 1 )
                    if col >= 0:
                        object = context.get( prefix[ :col ] )
                        if object is not None:
                            logger.debug( '\tto method [%s] on handler[%s]',
                                          name, h )
                            method = getattr( h, name )
                            trait_name = prefix[col + 1:]
                            self._dispatchers.append(
                                Dispatcher( method, info, object, trait_name )
                            )

                            # Also invoke the method immediately so initial
                            # user interface state can be correctly set.
                            if object.base_trait( trait_name ).type != 'event':
                                method( info )

                # fixme: These are explicit workarounds for problems with:-
                #
                # 'GeometryHierarchyViewHandler'
                #
                # which is used in the :-
                #
                # 'GeometryHierarchyTreeEditor'
                #
                # which are in the 'encode.cad.ui.geometry' package.
                #
                # The tree editor has dynamic views, and hence the handler gets
                # wrapped by a 'DelegatingHandler'. Unfortunately the handler
                # has a couple of methods that aren't picked up by the usual
                # wrapping strategy:-
                #
                # 1) 'tree_item_selected'
                #
                # - which is obviously called when a tree item is selected.
                #
                # 2) 'inspect_object'
                #
                # - which is called directly as as action from the context menu
                #   defined in the tree editor.
                #
                elif name in [ 'tree_item_selected', 'inspect_object' ]:
                    self.__dict__[ name ] = self._create_delegate( h, name )

        return True
Initializes the controls of a user interface.
dataset/ETHPy150Open enthought/traitsui/traitsui/delegating_handler.py/DelegatingHandler.init