populate a pulldown menu with folders from a list.

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

populate a pulldown menu with folders from a list.

Post by reelstuff » Sat Feb 06, 2010 3:39 pm

I am trying to create a list of MP3 files in folders using a QT player, to play the files,

So far I can list mp3 files in a single folder, and play those files one by one,

I have several folders with MP3 files, I was hoping to create a pulldown menu
where the folders of the active directory is listed, so I could change from folder to folder listing the mp3 files of each folder.

Code: Select all

# Returns a filtered list of folders in the current directory
function filteredFolders
  return filterDots(the folders)
end filteredFolders
I attempted to call the above function and store the result so I could try to create a list of folder for the pull down menu,

But I could get no result,

Code: Select all

on mouseUp
   filteredFolders
   put it into fld "foldersList"
end mouseUp
I am not sure where I am going wrong, I tried calling the function several times,

function filteredFolders is in the stack script, is there a special method of calling functions contained in the stack?

As an aside note, I tested in a revlet, and was able to load the QT player controls, but they are unresponsive,

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: populate a pulldown menu with folders from a list.

Post by Klaus » Sat Feb 06, 2010 5:09 pm

HI reelstuf,

at first glance:

Code: Select all

on mouseUp
   GET filteredFolders()
   put it into fld "foldersList"
end mouseUp
OR shorter:

Code: Select all

on mouseUp
   put filteredFolders() into fld "foldersList"
end mouseUp
Best

Klaus

P.S:
If I remember right, QuickTime players in Revlets have always set their "alwaysbuffer"
set to true, which makes this quite unusable :(

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Re: populate a pulldown menu with folders from a list.

Post by reelstuff » Sat Feb 06, 2010 6:06 pm

Thanks Klaus, I can see how it works now, also perhaps they will change, up the revlet in the future.

thanks for taking time to post, it is always appreciated.

Tim

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4002
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: populate a pulldown menu with folders from a list.

Post by bn » Sat Feb 06, 2010 6:27 pm

Tim,
you can make your own controls in a revlet to issue the play and stop command. Have a look at:
http://berndniggemann.on-rev.com/movieRevlet/
this is just a proof of principle stack. It could look nicer.
Dixie started to script QTVR, (panorama movies) which are broken at the moment in revlet. He and I came up with a nice implementation
http://berndniggemann.on-rev.com/qtvr/
regards
Bernd

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Re: populate a pulldown menu with folders from a list.

Post by reelstuff » Sat Feb 06, 2010 7:01 pm

very nice, I will have to check that out, thanks for posting.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9837
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: populate a pulldown menu with folders from a list.

Post by FourthWorld » Sat Feb 06, 2010 9:04 pm

bn wrote:Tim,
you can make your own controls in a revlet to issue the play and stop command. Have a look at:
http://berndniggemann.on-rev.com/movieRevlet/
Why does that stack request permission to access my hard drive?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4002
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: populate a pulldown menu with folders from a list.

Post by bn » Sat Feb 06, 2010 10:29 pm

Richard,
Why does that stack request permission to access my hard drive?
It does not access the harddrive. It was just a very quick and dirty revlet I did some time ago when the question of whether and how to operate a player in a revlet came up.
Comming to think, there is a button that I used in the stack to set the filename of the player, it is not working in the revlet, maybe that is why the automatic Security Setting came up with this.
I will change the revlet by setting the Security settings right.
Thanks for pointing it out because I don't see it anymore since I accepted the settings a long time ago.
regards
Bernd

EDIT
I changed the revlet, it should not ask for any permissions anymore and now it show the currenttime of the movie in the scrollbar, you can pause/resume the movie, clicking in the player starts/stops the player.

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”