Determining if menubar is visible

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
DarkKnight
Posts: 17
Joined: Tue May 10, 2016 3:22 am

Determining if menubar is visible

Post by DarkKnight » Sun Aug 11, 2024 2:37 pm

How do I determine if the menubar is visible?

using "the visible of the menubar" does not work

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Determining if menubar is visible

Post by Klaus » Sun Aug 11, 2024 4:09 pm

In the IDE or standalone?
Mac or Windows?

While a (system) menubar is always visible on a Mac, you may want to check for the RevMenubar in the IDE:

Code: Select all

put the visible of stack "revmenubar"

DarkKnight
Posts: 17
Joined: Tue May 10, 2016 3:22 am

Re: Determining if menubar is visible

Post by DarkKnight » Sun Aug 11, 2024 9:26 pm

In the IDE on a Mac. Checking the visibility of the revMenubar stack doesn’t work. It returns the same result when the menubar is hidden as it does when it is visible.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Determining if menubar is visible

Post by Klaus » Sun Aug 11, 2024 9:38 pm

Are we talking about the same thing?
See screenshots, one with "Toolbar text" (= stack "revmenubar") shown and one without.
menubar1.png
menubar2.png

DarkKnight
Posts: 17
Joined: Tue May 10, 2016 3:22 am

Re: Determining if menubar is visible

Post by DarkKnight » Sun Aug 11, 2024 10:11 pm

No we aren't. I'm referring the actual Mac OS menubar that is hidden/shown with "hide menubar"/"show menubar". Is there a way to determine if it is visible or not? In SuperCard it was possible to "get the visible of the menubar", but I haven't been able to find something similar in LC.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Determining if menubar is visible

Post by bn » Sun Aug 11, 2024 11:51 pm

Hi,

I tried to use the working screenrect to determine if the Mac menubar is visible or not.
On my MacBook Pro with a "notch" (where the camera is) it changed from

Code: Select all

on mouseUp
   hide menubar
   put the working screenrect
end mouseUp

Code: Select all

on mouseUp
   show menubar
   put the working screenrect
end mouseUp
Visible:
0,38,1728,1117

Hidden
0,32,1728,1117

So the top (item 2 of the working screenrect) changes.

Maybe that helps
Kind regards
Bernd

DarkKnight
Posts: 17
Joined: Tue May 10, 2016 3:22 am

Re: Determining if menubar is visible

Post by DarkKnight » Mon Aug 12, 2024 1:04 am

Yes that does help. On a desktop with no notch, the working rect is 0,23,2560,1080 when the menubar is visible and 0,0,2560,1080 when it is hidden.
So if the working screenrect = the screenrect then the menubar is hidden, on a display without a notch.

Post Reply