Пример #1
0
    def setInternalPadding(self, *pads):
        """
        Change the amount of internal padding used by all buttons.

        Argument is a 2-tuple of ints, or two ints.
        
        Returns the result of the delegation (i.e., True if delegates
        agreed to doing it). Raises a ButtonBoxError if anything bad
        happens.
        """
        try:
            xpad, ypad = pads
        except ValueError:
            xpad, ypad = pads[0]
        if self.delegate('will_set_internal_padding', args=(xpad, ypad)):
            try:
                self._doSetInternalPadding(xpad, ypad)
            except:
                raise ButtonBoxError, _("Unable to set internal padding")
            return True
        return False
Пример #2
0
    def setMinChildSize(self, *mins):
        """
        Set the minimum size of child widgets.

        Argument is a 2-tuple of ints, or two ints.

        Returns the result of the delegation (i.e., True if delegates
        agreed to doing it). Raises a ButtonBoxError if anything bad
        happens.
        """
        try:
            min_width, min_height = mins
        except ValueError:
            min_width, min_height = mins[0]
        if self.delegate('will_set_child_size', args=(min_width, min_height)):
            try:
                self._doSetMinChildSize(min_width, min_height)
            except:
                raise ButtonBoxError, _("Unable to set minimum child size")
            return True
        return False
Пример #3
0
    def setMinChildSize(self, *mins):
        """
        Set the minimum size of child widgets.

        Argument is a 2-tuple of ints, or two ints.

        Returns the result of the delegation (i.e., True if delegates
        agreed to doing it). Raises a ButtonBoxError if anything bad
        happens.
        """
        try:
            min_width, min_height = mins
        except ValueError:
            min_width, min_height = mins[0]
        if self.delegate('will_set_child_size', args=(min_width, min_height)):
            try:
                self._doSetMinChildSize(min_width, min_height)
            except:
                raise ButtonBoxError, _("Unable to set minimum child size")
            return True
        return False
Пример #4
0
    def setInternalPadding(self, *pads):
        """
        Change the amount of internal padding used by all buttons.

        Argument is a 2-tuple of ints, or two ints.
        
        Returns the result of the delegation (i.e., True if delegates
        agreed to doing it). Raises a ButtonBoxError if anything bad
        happens.
        """
        try:
            xpad, ypad = pads
        except ValueError:
            xpad, ypad = pads[0]
        if self.delegate('will_set_internal_padding', args=(xpad, ypad)):
            try:
                self._doSetInternalPadding(xpad, ypad)
            except:
                raise ButtonBoxError, _("Unable to set internal padding")
            return True
        return False
Пример #5
0
    def setChildSecondary(self, child, is_secondary):
        """
        Set whether child should appear in a secondary group of
        children.

        A typical use of a secondary child is the help button in a
        dialog.

        Takes one argument, True or False.
        
        Returns the result of the delegation (i.e., True if delegates
        agreed to doing it). Raises a ButtonBoxError if anything bad
        happens.
        """
        if self.delegate('will_set_child_secondary',
                         args=(child, is_secondary)):
            try:
                self._doSetChildSecondary(child, is_secondary)
            except:
                raise ButtonBoxError, _("Unable to set child as secondary")
            return True
        return False
Пример #6
0
    def setLayout(self, layout_style):
        """
        Change the way the buttons are arrange in the container.

        layout_style can be one of:
          'default':  reset to default
           'spread':  buttons are evenly spread across the ButtonBox
             'edge':  buttons are placed at the edges of the ButtonBox.
            'start':  buttons are grouped towards the start of box.
              'end':  buttons are grouped towards the end of a box.

        Returns the result of the delegation (i.e., True if delegates
        agreed to doing it). Raises a ButtonBoxError if anything bad
        happens.
        """
        if self.delegate('will_set_layout', args=layout_style):
            try:
                self._doSetLayout(layout_style)
            except:
                raise ButtonBoxError, _("Unable to set layout style")
            return True
        return False
Пример #7
0
    def setChildSecondary(self, child, is_secondary):
        """
        Set whether child should appear in a secondary group of
        children.

        A typical use of a secondary child is the help button in a
        dialog.

        Takes one argument, True or False.
        
        Returns the result of the delegation (i.e., True if delegates
        agreed to doing it). Raises a ButtonBoxError if anything bad
        happens.
        """
        if self.delegate('will_set_child_secondary',
                         args=(child, is_secondary)):
            try:
                self._doSetChildSecondary(child, is_secondary)
            except:
                raise ButtonBoxError, _("Unable to set child as secondary")
            return True
        return False
Пример #8
0
    def setLayout(self, layout_style):
        """
        Change the way the buttons are arrange in the container.

        layout_style can be one of:
          'default':  reset to default
           'spread':  buttons are evenly spread across the ButtonBox
             'edge':  buttons are placed at the edges of the ButtonBox.
            'start':  buttons are grouped towards the start of box.
              'end':  buttons are grouped towards the end of a box.

        Returns the result of the delegation (i.e., True if delegates
        agreed to doing it). Raises a ButtonBoxError if anything bad
        happens.
        """
        if self.delegate('will_set_layout', args=layout_style):
            try:
                self._doSetLayout(layout_style)
            except:
                raise ButtonBoxError, _("Unable to set layout style")
            return True
        return False