Erratic drawers - OS X

Jan Schenkel janschenkel at yahoo.com
Mon Apr 26 14:30:43 EDT 2004


--- David Vaughan <dvk at dvkconsult.com.au> wrote:
> I am seeing erratic behaviour with drawers.
> 
> First one:
> Create a stack with a menubar. Create a substack of
> it. Add a button to 
> the main stack to show the substack as a drawer (at
> bottom, if it 
> matters).
> 
> When you press the button to show the drawer (a
> problem in itself as 
> discussed below) then the menubar switches to the
> stack menus. The Rev 
> IDE menus can be restored by selecting the Pointer
> tool, but the 
> behaviour seems strange in any event. Anyone seen
> this or have an 
> explanation?
> 

That's because for stacks which don't have a mpenubar
of their own, the engine will use the defaultMenubar,
which inside the IDE is, well, the menuBar of the IDE.

> Second one:
> Using the "drawer" command and "hide" or "close" to
> close the drawer 
> does not seem to work as advertised. To slide out
> the drawer for the 
> first time requires additional code to show the
> stack and to maintain 
> normal open/close after that requires some other
> code as indicated by 
> the script from a test stack below. Without the
> elaboration of the 
> property, the position can arise (without a precise
> recipe yet) where 
> the drawer simply will not appear.
> 
> on mouseUp
>    get the propLocOn of stack "Locations" -- set to
> 0 on openStack
>    switch it
>    case 0
>      drawer stack "Locations" at bottom
>      show stack "Locations"
>      set the propLocOn of stack "Locations" to 2
>      break
>    case 1
>      show stack "locations"
>      if the visible of stack "Locations" then
>        set the propLocOn of stack "Locations" to 2
>      else
>        set the propLocOn of stack "Locations" to 0
>      end if
>      break
>    case 2
>      hide stack "locations"
>      set the propLocOn of stack "Locations" to 1
>      break
>    end switch
> end mouseUp
> 
> I have already buzilla'd the first problem but will
> delete if someone 
> has a good explanation.
> 
> thanks
> David
> 

Hmm, I'm not exactly sure why this sample code is the
way it is. You should be able to get by using just the
drawer and close commands.
--
on mouseUp
  put the uDrawerOpen of me into tOpenFlag
  if tOpenFlag
  then close stack "MyDrawerStack"
  else drawer stack "MyDrawerStack" at bottom
  set the uDrawerOpen of me to not tOpenFlag
end mouseUp
--

Hope 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! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash


More information about the use-livecode mailing list