Differentiating a substack from a mainstack

Mark Wieder mwieder at ahsoftware.net
Thu Nov 21 00:17:14 EST 2013


Wednesday, November 20, 2013, 6:46:10 PM, you wrote:

> On Wed, Nov 20, 2013 at 5:40 PM, Mark Wieder <mwieder at ahsoftware.net> wrote:

>> You *could* get really tricky and hijack the menu...

> That gave me an idea which seems to work - check the menuhistory of the
> File menu button of revMenuBar in openStack.  Seems to work, 1=mainstack,
> 2=substack of the topstack.

> Is that tricky enough?

That's pretty clever. I didn't think of doing it that way.
When I mess around with the menubar (or any of the IDE stacks) I try
to bracket the code with stuff to make sure what environment I'm in.
Your menubar hack should work with everything to date, but if the
menubar changes in the future or you want this to work with rIDE you
may have to code something different. Along the lines of:

function getIDEStackName pRevIDEStackName
  if there is a stack pRevIDEStackName then
    return pRevIDEStackName
    switch pRevIDEStackName
      case "revmenubar"
        return "someOtherMenubar"
      case "revTools"
        return "someOtherToolPalette"
      case whatever
        -- etc
    end switch
  end if
end getIDEStackName

-Mark Wieder
 ahsoftware at gmail.com

More information about the Use-livecode mailing list