Has anyone ever used the iconifyStack and unIconifyStack

Jan Schenkel janschenkel at yahoo.com
Tue Feb 3 05:46:49 EST 2004


--- Martin Baxter <martin at harbourtown.co.uk> wrote:
> 
> > Thomas McGrath III wrote
> >I want the main stack and it's substacks to
> minimize when one of them
> >is minimized.
> >The user may minimize either the main stack and
> then it's substacks
> >that are open will minimize OR they may minimize a
> substack and the
> >main stack & other substacks will minimize.
> >
> >I can't seem to figure it out.
> 
> >1. the dock shows multiple stacks minimized. Any
> way around that?
> 
> Don't know
> 
> >2. the iconifyStack message does not send ?? in 30
> mills
> >3. the uniconifyStack does not send to the other
> minimized stacks
> 
> It looks like you are treating uniconifyStack /
> iconifyStack messages as if
> they were commands, but they are only event
> notification messages that the
> system sends and don't really do anything.
> Try setting the iconic property instead.
> "set the iconic of stack "whatever" to false/true"
> To minimise or maximise a stack
> 
> so: (untested - and off the top of my head)
> 
> on iconifyStack
>   put the openstacks into tvar
>   put the short name of this stack into myname
>   repeat for each line i in tvar
>     if i <> myname then
>       set the iconic of stack i to true
>     end if
>   end repeat
> end iconifystack
> 
> might do what you want
> 
> >4. the system seems to hang up and I have to force
> quit.
> Perhaps your script is calling itself recursively.
> Hence in the script
> above the check for the name of the current stack
> 
> HTH Martin
> 

I'd like to chime in for a second, as Martin is
correct in assuming that this runs off into an
infinite loop : if the substack doesn't have an
iconifyStack handler of its own, the mainstack will
get the same message again.
So the solution is probably along the lines of :
--
local sBusyIconifying
on iconifyStack
  -- exit if we're already iconifying
  if sBusyIconifying is true
  then exit iconifyStack
  else put true into sBusyIconifying
  -- now that we've set the flag
  -- proceed by iconifying the other stacks
  put the openstacks into tvar
  put the short name of this stack into myname
  repeat for each line i in tvar
    if i <> myname then
      set the iconic of stack i to true
    end if
  end repeat
  -- clear the flag again for next time
  put false into sBusyIconfying
end iconifystack
--

Hipe this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


More information about the use-livecode mailing list