Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next - prev problem #1

Open
Axel-Erfurt opened this issue Sep 29, 2022 · 0 comments
Open

next - prev problem #1

Axel-Erfurt opened this issue Sep 29, 2022 · 0 comments

Comments

@Axel-Erfurt
Copy link

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])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant