Skip to content

next - prev problem #1

@Axel-Erfurt

Description

@Axel-Erfurt

That works better for me

    # Used to select next or prev media 
    def cust_func(self, next=True): 
        playlist = self.playlistBox.get_children()
        currentIndex = playlist.index(self.playlistBox.get_selected_row())
        if(currentIndex <= len(playlist) - 1):
            if(next):
                if not (currentIndex) == len(playlist) - 1:
                    currentIndex += 1
                else:
                    currentIndex = 0
            else:
                currentIndex -= 1
        else:
            currentIndex += 1

        self.playlistBox.select_row(playlist[currentIndex])
        # calling the signal handler manually
        self.onSelectionActivated(self.playlistBox, playlist[currentIndex])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions