How to find the visible card in the Application Browser

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
Reinhold
Posts: 4
Joined: Wed May 31, 2006 11:38 am

How to find the visible card in the Application Browser

Post by Reinhold » Wed May 31, 2006 11:56 am

Hi!

I just changed from Metacard to Revolution. When I launched the Control Browser in Metacard, it shows me the visible card. In Revolution the Application Browser ask me to select a card.
My stack has some hundreds of cards and the only way I know to get the visible card is to ask for the cardID in the Message Box and searching for it in the cardlist of the AppBrowser. It is like playing lottery, because the cards are not sorted by ID.
Is there any more harmful way to get it?

Reinhold

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Wed May 31, 2006 12:13 pm

Hi,

AFAIK, the built-in application browser doesn't do this, but you could make a little plug-in for yourself. Make a new stack with a button and a field. In the button, put the following script:

on mouseUp
put the cardnames of the topstack into fld "Card Names"
put lineoffset(short name of this cd of the topstack,fld "Card Names") into myCd
set the textColor of line myCd of fld "Card Names" to red
end mouseUp

Also make a field named "Card Names". Make sure that the stack opens as a palette and if you want, add a script in an openCard handler that does the same as the button:

on preOpenCard
send mouseUp to btn "Your Button'
end preOpenCard

I have a similar plugin, which works in Rev 2.7.1. I didn't test the script as posted here, so you might have to tweak a little.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”