def METHOD_NAME(self, x, y, width, height):
    # Convert the width and height back into terminal coordinates
    self.native.styles.width = self.scale_in_horizontal(width)
    self.native.styles.height = self.scale_in_vertical(height)
    # Positions are more complicated. The (x,y) provided as an argument is
    # in absolute coordinates. The `content_left` ad `content_right` values
    # of the layout are relative coordianate. Textual doesn't allow specifying
    # either absolute *or* relative - we can only specify margin values within
    # a row/column box. This means we need to reverse engineer the margins from
    # the computed layout.
    parent = self.interface.parent
    if parent is None:
        # Root object in a layout; Margins are the literal content offsets
        margin_top = self.interface.layout.content_top
        margin_right = self.interface.layout.content_right
        margin_bottom = self.interface.layout.content_bottom
        margin_left = self.interface.layout.content_left
    else:
        # Look for this widget in the children of the parent
        index = parent.children.index(self.interface)
        if index == 0:
            # First child in the container; margins are the literal content offsets
            margin_top = self.interface.layout.content_top
            margin_right = self.interface.layout.content_right
            margin_bottom = self.interface.layout.content_bottom
            margin_left = self.interface.layout.content_left
        else:
            # 2nd+ child in the container. Right and Bottom content offsets are as
            # computed by layout. If the parent is a row box, the top offset is as
            # computed, but the left offset must be computed relative to the right
            # margin of the predecessor. If the parent is a column box, the left
            # offset is as computed, but the top offset must be computed relative to
            # the bottom margin of the predecessor.
            predecessor = parent.children[index - 1]
            margin_top = self.interface.layout.content_top
            margin_right = self.interface.layout.content_right
            margin_bottom = self.interface.layout.content_bottom
            margin_left = self.interface.layout.content_left
            # The layout doesn't have a concept of flow direction; this is a
            # property of the style language. However, we don't have any other way
            # to establish whether this is a row or a column box.
            if parent.style.direction == ROW:
                margin_left -= (
                    predecessor.layout.content_left
                    + predecessor.layout.content_width
                    + predecessor.layout.content_right
                )
            else:
                margin_top -= (
                    predecessor.layout.content_top
                    + predecessor.layout.content_height
                    + predecessor.layout.content_bottom
                )
    # Convert back into terminal coordinates, and apply margins to the widget.
    self.native.styles.margin = (
        self.scale_in_vertical(margin_top),
        self.scale_in_horizontal(margin_right),
        self.scale_in_vertical(margin_bottom),
        self.scale_in_horizontal(margin_left),
    )