songlist selection (pymt)
Posted: 29 August 2012 07:19 PM   [ Ignore ]
Rank
Joined  2012-08-29
Total Posts:  2
New Member

Hi, I’m new to this forum, and python , and pymt. So my friend ask me to write him a basic karaoke program for a touchscreen, so I went online and found pykaraoke, however he didn’t like the rather dated graphics and wanted me to make one that had better style. Which led me to pymt, but now I have the hardest easiest problem I have ever had..

I have the database of all my songs on my pc. And I got most of the Gui, but I’m having trouble. I have MTTextInput to get the search string , then I do the search, and I then put each Title of the songs into a MTkineticitem, and then add that item to the mtkineticlist. my problem is, how do i do it so that when one of these items is touched it is removed from the first list, and added to the queue(also a mtkineticlist, with kineticitems) and then how do i get the player to start playing from the top of the queue? I have it as a for loop, so each song is put into a kineticitem and then that is added to the list, but it doesn’t work. I cant see where I went wrong, it will either not display anything in any list, or if it does display a list of songs in the selectlist, then when I touch one (doesn’t matter which one) the bottom most song on the list is the only one added to the queuelist. I have tried to add on_press to the item and I get is that the queue has an identical list.

for song in songlist
    founditem 
MTKineticItem(label=song,size=(600,50))
    @
founditem.event
    def on_press
():
        
queuelist.add_widget(founditem)
    
selectlist.add_widget(founditem)
"""this didnt work, also tried"""
    
for song in songlist
        founditem 
MTKineticItem(label=song,size=(600,50))
        
founditem.push_handlers(on_press=curry(queuelist.add_widget(founditem)))
        
selectlist.add_widget(founditem)
#also tryed to put it directly into my own class, still not working
#so now i tried to make it a MTList, and so I had to add a box layout
        
for song in songList:
            
slist []
            founditem 
MTKineticItem(label=song.Title,cls='search',size=(600,50))
            
foundbox.add_widget(founditem)

            @
founditem.event
            def on_press
(*largs):
                
selecteditemMTKineticItem(label=song.Title,cls='search',size=(600,50))
                
selectedbox.add_widget(selecteditem)

foundbox is the boxlayout that i use in the selectlist-MTList, and selectedbox is used in queuelist- MTList

that puts up the founditem in the foundbox very nicely, but when i press on them, the only thing that shows up in selectedbox is the first item at the bottom in the foundlist. Doesn’t matter if I pressed the top one or the middle one, it just comes out as if i pressed the first founditem over and over.

that didnt work, I can’t seem to find anything online to help with this, all I want is for the user to see a list of songs, and pick which one they want to add to the queue. I don’t know why such a simple thing has been giving me problems for the past week. Please help. songlist is the file that contains the songs that match the search criteria
. Thanks for any help, iv been stopped completely by this for a week so far.

Also I tried to do a while loop instead of a for. it lists the songs in the foundbox, but when i click on a song It posts the song into the selected box, but only the first record at the bottom of the foundbox, doesn’t matter which song i clicked,and then any more clicks and it puts a blank entry into the selected box, very weird.

Profile