コード例 #1
0
    def _set_key(self, entry, icon_pos, event):
        """ Generate current permutation from the key entry box.

        Args:
            entry: the key entry widget that trigered the event
            icon_pos: position of the icon that trigered the event
            event: the event that trigered this handler
        """
        self.set_permutation(Permutation.from_key(entry.get_text()))
コード例 #2
0
    def _set_affine(self, *args):
        """ Generate current permutation from entries in the affine box.

        Args:
            *args: arguments provided by the signal
        """
        mult = int(self._mult_field.get_active_text())
        add = int(self._add_field.get_active_text())
        self.set_permutation(Permutation.affine(mult, add))
コード例 #3
0
    def _translate(self, widget, amount):
        """ A handler method that aplies a translation to the selected
        permutation.

        Args:
            widget: widget that trigered the event
            amount: numnber of position to translate for
        """
        self.apply_permutation(Permutation.shift(amount))