    def __init__(self, frame, has_border, can_scroll):
        """
        Helper class to manage the border and scroll bar attached to a frame.
        Allows for different character to be used in the border and the
        changes in sizing requirements with borders on and off with scroll
        bars on and off.

        :param frame: frame being manager
        :param has_border: True if the frame has a border
        :param can_scroll: True if the frame has a scroll bar
        """
        self._frame = frame
        self.has_border = has_border
        self.scroll_bar = None
        self.box = BoxTool(frame.canvas.unicode_aware)
        if can_scroll:
            scroll_y = 2
            scroll_height = frame.canvas.height - 4
            if not has_border:
                scroll_height = frame.canvas.height - 2
                scroll_y = 1

            self.scroll_bar = _ScrollBar(
                frame.canvas, frame.palette, frame.canvas.width - 1, scroll_y, scroll_height,
                frame.get_scroll_pos, frame.set_scroll_pos, absolute=True
            )

        # Optimization for non-unicode displays to avoid slow unicode calls.
        self.string_len = wcswidth if frame._canvas.unicode_aware else len
Helper class to manage the border and scroll bar attached to a frame.
Allows for different character to be used in the border and the
changes in sizing requirements with borders on and off with scroll
bars on and off.

:param frame: frame being manager
:param has_border: True if the frame has a border
:param can_scroll: True if the frame has a scroll bar
asciimatics/widgets/frame.py