Hiding stacks from the Project 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: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

AndyP
Posts: 449
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Hiding stacks from the Project Browser

Post by AndyP » Thu Sep 05, 2019 9:03 pm

As it stands at the moment, if you want to hide a stack from the Project Browser the only option seems to be to prefix the stack name with rev and then set to hide rev stacks in the preferences.

With the advent of script only stacks a plugin may now have many behavior stacks which may swamp the Project Browser leaving the stack you are working on lost in the list.

So my question is, does anyone know of a recipe for hiding stacks from the Project Browser that doesn't rely on the rev prefix?
Andy Piddock

http://2108.co.uk/tinyide/ - Mini LC IDE alternative

http://2108.co.uk/script-editor-themer/ - Script Editor colour theming

http://livecodeshare.runrev.com/stack/897/LiveCode-Multi-Search - Search across 8 LC resources

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

Re: Hiding stacks from the Project Browser

Post by FourthWorld » Thu Sep 05, 2019 9:22 pm

It would seem useful to request an engagement that provides an option to hide plugin stacks from the PB.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

AndyP
Posts: 449
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Hiding stacks from the Project Browser

Post by AndyP » Thu Sep 05, 2019 9:37 pm

Yes indeed, maybe in the plugin settings so that each plugin can have the option to hide if required.

As there is an option to hide rev stacks in the preferences has anyone been able to track down the code that actually achieves this? I had a look but ended up going round in circles!!
Andy Piddock

http://2108.co.uk/tinyide/ - Mini LC IDE alternative

http://2108.co.uk/script-editor-themer/ - Script Editor colour theming

http://livecodeshare.runrev.com/stack/897/LiveCode-Multi-Search - Search across 8 LC resources

bogs
Posts: 3932
Joined: Sat Feb 25, 2017 10:45 pm

Re: Hiding stacks from the Project Browser

Post by bogs » Thu Sep 05, 2019 9:42 pm

I can't think of any other way, but that isn't a surprise either.
Image

AndyP
Posts: 449
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Hiding stacks from the Project Browser

Post by AndyP » Thu Sep 05, 2019 9:50 pm

Time for an enhancement request me thinks.
Andy Piddock

http://2108.co.uk/tinyide/ - Mini LC IDE alternative

http://2108.co.uk/script-editor-themer/ - Script Editor colour theming

http://livecodeshare.runrev.com/stack/897/LiveCode-Multi-Search - Search across 8 LC resources

bogs
Posts: 3932
Joined: Sat Feb 25, 2017 10:45 pm

Re: Hiding stacks from the Project Browser

Post by bogs » Thu Sep 05, 2019 10:07 pm

You know what I wonder (and haven't tested), is whether you can change the name of the stack in say, the preOpenStack handler, then change it back in the closeStack handler. Something like...

Code: Select all

on preOpenStack
	set the name of stack "myBehaviorStack" to "revBehaviorStack"
end preOpenStack

on closeStack
	set the name of stack "revBehaviorStack" to "myBehaviorStack"
	pass closeStack
end closeStack
The real question becomes, will you get that annoying dialog that asks you if you really want to do that or not :roll:

*Edit - a second real question becomes, whats the problem with just naming the stacks with the rev prefix??
Image

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2843
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Hiding stacks from the Project Browser

Post by mwieder » Fri Sep 06, 2019 12:25 am

I made the suggestion a while back, but we weren't able to come up with a good criterion for selecting which stacks to hide. Navigator, for example, has a zillion (I counted them) script-only behavior stacks which pollute the stack listing in the Project Browser if you're looking at system stacks. They're already named "rev..." so that keeps them out of view if you don't have that option checked.

There *is* another option... if the stack has a custom property of "_ideoverride" set the true then that's the same as the "rev" prefix for the stack name. See the comment before revIDEStackNameIsIDEStack() in stack revIDElibrary.8.livecodescript.

A modest suggestion: In the revFilterStacksList() function in the revcommonlibrary.livecodescript stack script there's a dispatch to revHookIsUserStack() and a check to see if the returned value is false. If there's no function in the messagepath with that name (currently the situation) then the given stack is placed on the list of displayable stacks.

So leveraging that (a multi-part proposal) by
1. adding an option to the Project Browser to set a "hide script-only stacks" property in the Preferences stack
2. creating a revHookIsUserStack() function in a backscript so it's in the message path (I'd suggest adding it to "revIDEProjectBrowserLibrary"

Code: Select all

function revHookIsUserStack pStackLongID
  local tReturn

  put true into tReturn
  if the hideScriptOnlyStacks of stack "revIDEPreferences" then
    if pStackLongID ends with "livecodescript" then
      put false into tReturn
    end if
  end if
  return tReturn
end revHookIsUserStack

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

Re: Hiding stacks from the Project Browser

Post by FourthWorld » Fri Sep 06, 2019 3:15 am

mwieder wrote:
Fri Sep 06, 2019 12:25 am
I made the suggestion a while back, but we weren't able to come up with a good criterion for selecting which stacks to hide.
...
There *is* another option... if the stack has a custom property of "_ideoverride" set the true then that's the same as the "rev" prefix for the stack name.
I'd forgotten about that. With things being so open in LC, a custom property may be as good as it gets. We just have to promote its use by plugin makers. And it might be nice if someone made a tool to add it to stack files in the Plugins folders.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2843
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Hiding stacks from the Project Browser

Post by mwieder » Fri Sep 06, 2019 4:49 am

I recently discovered that property, and it enabled me to rename the "revPowerDebug" stack to "PowerDebug".

AndyP
Posts: 449
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Hiding stacks from the Project Browser

Post by AndyP » Fri Sep 06, 2019 9:09 am

The custom property of "_ideoverride" looks like the way to go. Didn't know about this one.

It would be great to rename my plugins omitting the rev suffix as it make editing the binary stack sooo much easier.

Thanks for all the suggestions and help on this one....time to code!
Andy Piddock

http://2108.co.uk/tinyide/ - Mini LC IDE alternative

http://2108.co.uk/script-editor-themer/ - Script Editor colour theming

http://livecodeshare.runrev.com/stack/897/LiveCode-Multi-Search - Search across 8 LC resources

AndyP
Posts: 449
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Hiding stacks from the Project Browser

Post by AndyP » Fri Sep 06, 2019 10:02 am

Another interesting thing I just noticed is that if you have a folder such as TinyIDE_Behaviors in the plugins folder containing script only stacks these will automatically be displayed in the Project Browser, whereas if the folder is named for example TinyIDE_Scripts then these will not be automatically displayed and boy did it take me a long time to figure this one out. This helps to explain why I was seeing the Project Browser fill.

:roll: edit> No this is a red herring! just restarted LC and all the behavior scripts are displaying again..aHHH!
However what does seem to the issue is how the behaviour file is named.

so, button_Btn2108Web_10010.livecodescript will automatically be displayed
but, button_Btn2108Web_10010_.livecodescript with (_) at the end of the name does not display.

So I'm off to rename all the behavior files and re-link... what fun!
Andy Piddock

http://2108.co.uk/tinyide/ - Mini LC IDE alternative

http://2108.co.uk/script-editor-themer/ - Script Editor colour theming

http://livecodeshare.runrev.com/stack/897/LiveCode-Multi-Search - Search across 8 LC resources

bogs
Posts: 3932
Joined: Sat Feb 25, 2017 10:45 pm

Re: Hiding stacks from the Project Browser

Post by bogs » Fri Sep 06, 2019 12:33 pm

mwieder wrote:
Fri Sep 06, 2019 12:25 am
There *is* another option... if the stack has a custom property of "_ideoverride" set the true then that's the same as the "rev" prefix for the stack name. See the comment before revIDEStackNameIsIDEStack() in stack revIDElibrary.8.livecodescript.
Thank you so much for that!!
Image

AndyP
Posts: 449
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Hiding stacks from the Project Browser

Post by AndyP » Fri Sep 06, 2019 5:35 pm

So the saga is finally at an end .. what a frustrating day.

So what was happening was that every time I started LC all the scriptonly files for TinyIDE would automatically populate the Project Browser .. what!
This was with every thing else removed from the plugins folder just leaving the scriptonly files.

A couple of times I thought I had sorted the problem by renaming part of the files, renaming the folder etc etc .. but restarting LC a couple of times would then show the problem again, this still made no sense.

I had done the usual deleting of the preferences .. many times, still no joy.
I went as far as uninstalling all copies of LC, deleting all runrev and LC files and folders in the AppData folder, shutting down the computer, restarting and reinstalling LC and ... directly I set the path to plugins in the preferences, up the files would pop again...ARGGGHH!!

Now then, I created a new script only file and placed it in the TinyIDE folder, it did not show up in the PB..erm?
I took the contents from one of the existing files deleted the original and named the new file the same as the original, it showed up.
I did the same but saved the new file under a different name, it didn't show up...progress at last.

What it turned out to be is that if you have scriptonly files whose names start with button_, field_ , stack_, card_ etc in a sub folder of your plugins folder these (at least on my computer) are automatically loaded into the PB at launch ..scratch head.

Anyway I can start up LC and not see all the stack only files..now a happy bunny again.



tinyidelisted.png


Renamed files now absent from PB
Attachments
tinyideunlisted.png
Andy Piddock

http://2108.co.uk/tinyide/ - Mini LC IDE alternative

http://2108.co.uk/script-editor-themer/ - Script Editor colour theming

http://livecodeshare.runrev.com/stack/897/LiveCode-Multi-Search - Search across 8 LC resources

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2843
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Hiding stacks from the Project Browser

Post by mwieder » Fri Sep 06, 2019 6:28 pm

I've got a patch to the Project Browser on the way that will allow you to show or hide script-only stacks as desired.

AndyP
Posts: 449
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Hiding stacks from the Project Browser

Post by AndyP » Fri Sep 06, 2019 8:06 pm

Looking forward to it 😀
Andy Piddock

http://2108.co.uk/tinyide/ - Mini LC IDE alternative

http://2108.co.uk/script-editor-themer/ - Script Editor colour theming

http://livecodeshare.runrev.com/stack/897/LiveCode-Multi-Search - Search across 8 LC resources

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”