I'm sure this is pretty basic stuff but how can I get a list of all the open substacks in my app? By open, I mean that they have at least one card in them displayed to the user.
Thanks,
Pete
List of Open stacks
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 9857
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: List of Open stacks
I use the windows function, but note that it'll include windows which are invisible too, if your app has any of those. You can get a list of only visible windows like this:
Code: Select all
function VisWindows
put empty into tList
repeat for each line tWd in the windows
if the vis of stack tWd is true then
put tWd &cr after tList
end if
end repeat
delete last char of tList
return tList
return VisWindows
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: List of Open stacks
Thanks Richard, that sounds like just what I need. But it brings up another issue that has bugged me before.
The Dictionary says that the info returned by windows includes IDE stacks. This whole issue of the IDE being treated as part of an application is very frustrating to me. They are NOT part of my app, they are part of the tool that helps me develop my app. I have several front scripts that receive messages from IDE stacks which sometimes cause havoc. Minimum, my scripts or any built in functions should should not get messages from or include any reference to IDE stacks unless the option to include UI elements in the View menu is turned on. Next in line after that is a reliable way to tell if a message is coming from an IDE stack rather than one of my app's stacks. No doubt there are people who want or need to see IDE messages and that's fine - just provide a way to exclude them for those of us who don't want to see them.
Sorry for the rant but this has caused me a lot of problems over the last few months so any suggestions as to how to deal with it would be most welcome.
Thanks,
Pete
The Dictionary says that the info returned by windows includes IDE stacks. This whole issue of the IDE being treated as part of an application is very frustrating to me. They are NOT part of my app, they are part of the tool that helps me develop my app. I have several front scripts that receive messages from IDE stacks which sometimes cause havoc. Minimum, my scripts or any built in functions should should not get messages from or include any reference to IDE stacks unless the option to include UI elements in the View menu is turned on. Next in line after that is a reliable way to tell if a message is coming from an IDE stack rather than one of my app's stacks. No doubt there are people who want or need to see IDE messages and that's fine - just provide a way to exclude them for those of us who don't want to see them.
Sorry for the rant but this has caused me a lot of problems over the last few months so any suggestions as to how to deal with it would be most welcome.
Thanks,
Pete
-
- VIP Livecode Opensource Backer
- Posts: 9857
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: List of Open stacks
Yeah, the Rev IDE being made in Rev cuts both ways. Sometimes it means that their stuff and your stuff get comingled, but it also means that it's entirely modifiable, and even replaceable (I wrote my own, and there are other IDEs foating around as well).
In the case of stack lists, it's easy enough to filter out Rev stuff because they use a convention of naming their stack with a "Rev" prefix, so you can use:
filter tWdList without "rev*"
If these lists are built dynamically as it seems they are, this shouldn't affect anything in your apps since of course Rev's IDE windows won't be part of your standalone.
In the case of stack lists, it's easy enough to filter out Rev stuff because they use a convention of naming their stack with a "Rev" prefix, so you can use:
filter tWdList without "rev*"
If these lists are built dynamically as it seems they are, this shouldn't affect anything in your apps since of course Rev's IDE windows won't be part of your standalone.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: List of Open stacks
Thanks Richard. I thought about using the naming convention but seems to me that I've noticed a very few that don't start with "rev", maybe I'm wrong. Since the View menu option to include IDE stuff is able to easily identify IDE stacks, I was hoping there would be some other way to do this, like maybe a custom property that identifies the IDE stacks.
And I agree, having the IDE written in Rev can be a plus, just there ought to be some sort of option to hide anything to do with the IDE stacks.
Anyway, thanks for the code to close my windows, it works just fine.
Pete
And I agree, having the IDE written in Rev can be a plus, just there ought to be some sort of option to hide anything to do with the IDE stacks.
Anyway, thanks for the code to close my windows, it works just fine.
Pete