FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

MENUS

Hide the menu bar


Try this...
/*
      These routines are available with Mac OS 8.5 or later
      (Thanks to Derek Smith for this code)
*/

#IF cpuPPC
  LIBRARY "MenusLib"
  TOOLBOX FN IsMenuBarVisible = Boolean
  TOOLBOX ShowMenuBar
  TOOLBOX HideMenuBar
  LIBRARY
#ENDIF

BEGIN GLOBALS
  DIM gMenuBarHt
END GLOBALS

gMenuBarHt = {_mbarheight}
MENU 1,0,1,"File"
MENU 1,1,1,"Quit/Q"

WINDOW 1

LONG IF SYSTEM(_sysVers) < 850
  PRINT "Sorry. This requires system 8.5 or higher"
  BEEP : DELAY 1000 : END
XELSE
END IF

LOCAL FN checkMenuBar
  DIM @my,mx
  CALL GETMOUSE(my)
  CALL LOCALTOGLOBAL(my)
  LONG IF my < gMenuBarHt
    LONG IF FN IsMenuBarVisible = _false
      CALL ShowMenuBar
    END IF
  XELSE
    LONG IF FN IsMenuBarVisible
      CALL HideMenuBar
    END IF
  END IF
END FN

PRINT "Move the mouse over the menu bar to make it appear"

DO
  HANDLEEVENTS
  FN checkMenuBar
UNTIL 0
STAZ

He can download an example from our website :

http://www.stazsoftware.com/exmenu.html

David Blache

Poke zero into the appropriate low memory global :
oldMBarHeight% = {_mbarHeight}
%_mbarheight,0
The system clock looks at this to decide where to draw itself. If the value is zero, it doesn't draw.

Once you're done, put the original value back (don't just hardwire it) :

%_mbarheight,oldMBarHeight%
Mars