def METHOD_NAME(self):
    """Adds a status bar to the dialog."""
    ui = self.ui
    statusbar = ui.view.statusbar
    context = ui.context
    if statusbar is not None:
        widths = []
        listeners = []
        control = wx.StatusBar(self.control)
        control.SetFieldsCount(len(statusbar))
        for i, item in enumerate(statusbar):
            width = abs(item.width)
            if width <= 1.0:
                widths.append(-max(1, int(1000 * width)))
            else:
                widths.append(int(width))
            set_text = self._set_status_text(control, i)
            name = item.name
            control.SetStatusText(ui.get_extended_value(name), i)
            col = name.find(".")
            object = "object"
            if col >= 0:
                object = name[:col]
                name = name[col + 1 :]
            object = context[object]
            object.observe(set_text, name, dispatch="ui")
            listeners.append((object, set_text, name))
        control.SetStatusWidths(widths)
        self.control.SetStatusBar(control)
        ui._statusbar = listeners