Set stack as menu bar issues
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Set stack as menu bar issues
I am creating a macOS program that has a standard apple os menubar that was created in Menu Bar Builder.
There is a script in the stack that will move the window by selecting the edges -- however, the window jumps a few pixels upward when you have the mouse down. If I delete the menubar entirely or de-select the "Set as stack Menu Bar" in the Menu Bar Builder it works smoothly and correctly.
Is this a bug or do I need to add something in the code to deal with this?
I have included an example file.
Thank you for the help
There is a script in the stack that will move the window by selecting the edges -- however, the window jumps a few pixels upward when you have the mouse down. If I delete the menubar entirely or de-select the "Set as stack Menu Bar" in the Menu Bar Builder it works smoothly and correctly.
Is this a bug or do I need to add something in the code to deal with this?
I have included an example file.
Thank you for the help
- Attachments
-
- MoveIssue.livecode.zip
- (3.45 KiB) Downloaded 291 times
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Set stack as menu bar issues
Hi,
I understand mousedown of btn "moveWindows" should check if there is a menu "menubar" or not.
Unfortunately, i don't know yet how to do that but i'm sure some LiveCoders know it
From doc
"In LiveCode, the menus function always returns empty."
Best regards
Jean-Marc
I understand mousedown of btn "moveWindows" should check if there is a menu "menubar" or not.
Unfortunately, i don't know yet how to do that but i'm sure some LiveCoders know it
From doc
"In LiveCode, the menus function always returns empty."
Code: Select all
on mouseDown
put item 1 of the mouseLoc into sgLeftOffset
put item 2 of the mouseLoc into sgTopOffset
--•• pseudocode
-- if there is a menu "menubar" then
-- subtract 20 from sgTopOffset
-- end if
put true into sgDragging
end mouseDown
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Set stack as menu bar issues
I just found a way.
1.Create a new menu "myMenu" with an item "JustTest"
2. change mousedown of btn "moveWindow" like this:
1.Create a new menu "myMenu" with an item "JustTest"
2. change mousedown of btn "moveWindow" like this:
Code: Select all
on mouseDown
put item 1 of the mouseLoc into sgLeftOffset
put item 2 of the mouseLoc into sgTopOffset
if there is a menu "myMenu" then
subtract 20 from sgTopOffset
end if
put true into sgDragging
end mouseDown
It seems work
https://alternatic.ch
Re: Set stack as menu bar issues
That works!!!
Thank you so much.
Question... is there a logical reason why the window moves (jumps) in the first place or is this a bug?
Thank you so much.
Question... is there a logical reason why the window moves (jumps) in the first place or is this a bug?
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Set stack as menu bar issues
Not realy a bug for me (we have solved it without changing source code of LiveCode).Question... is there a logical reason why the window moves (jumps) in the first place or is this a bug?
Just an unexpected behavior
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 7258
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Set stack as menu bar issues
LiveCode menus are objects that take up room at the top of a card. On Windows, this is standard; menus appear at the top of each window. When the same stack is run on a Mac, LiveCode pushes the top portion of the card above the top border of the window, out of view. The body of the window shortens to accomodate only that portion of the card that contains the actual stack content. The card is still technically the same height, but the part of the height that contains the menu group is out of view.
The adjusted handler corrects for the difference between the top window frame and the actual top of the card.
The adjusted handler corrects for the difference between the top window frame and the actual top of the card.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com