Logo Search packages:      
Sourcecode: panflute version File versions  Download package

def panflute::applet::widget::Scroller::__pack_labels (   self  )  [private]

Re-pack the labels according to the current orientation.

Definition at line 433 of file widget.py.

00433                             :
        """
        Re-pack the labels according to the current orientation.
        """

        # Stop any scroll in progress

        if self.__update_source is not None:
            gobject.source_remove (self.__update_source)
            self.__update_source = None

        # Arrange the labels inside the space available

        sizes = []

        for label in self.__labels:
            # gtk.Label only supports non-zero angles if the ellipsize mode is NONE.
            if self.__angle == 0:
                label.set_ellipsize (pango.ELLIPSIZE_END)
            else:
                label.set_ellipsize (pango.ELLIPSIZE_NONE)
            label.set_angle (self.__angle)
            label.set_size_request (-1, -1)
            if self.__angle == 90 or self.__angle == 270:
                label.set_size_request (label.size_request ()[0], self.allocation.height)
            else:
                label.set_size_request (self.allocation.width, label.size_request ()[1])

        # Figure out which offsets to linger on

        if self.__angle == 90 or self.__angle == 270:
            delta = self.allocation.width
        else:
            delta = self.allocation.height
        self.__stops = [i * delta for i in range (len (self.__labels))]

        # Actually add the content to the scroller

        self.__immediately_refresh = True
        self.__set_offset (0)
        for label in self.__labels:
            label.show ()

        # Initialize the scroll position

        self.__path = self.__stops[1:]
        if len (self.__stops) > 1:
            self.__update_source = gobject.timeout_add (self.LINGER_INTERVAL, self.__begin_scroll)


    def do_size_request (self, requisition):


Generated by  Doxygen 1.6.0   Back to index