Add Vertical Drawer to Window

Is there a way to add a Vertical Drawer to the side of a Window that is not inside the actual Window? If so does it work for both Mac and Windows?

What do you mean by “vertical drawer” ? Could you post a picture of what you want to achieve ?

Drawers are/were a Mac only feature that Apple deprecated a couple years ago. It was removed in Xojo 2015r4 as its no longer supported.

See <https://xojo.com/issue/41328>

You can use Overlay window to with MBS Plugin and move it with Xojo Window.

I see. That looks old indeed. The Apple page is dated 2003-02-04. I am surprised it held for so long.

It’s that, right ?

https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Drawers/Concepts/DrawerSizing.html

It seems possible to do the same by careful management of a plain box window next to the main window.

I have seen declares in this forum to “attach” a window to another one, so they can be moved together. Unfortunately, I cannot locate that at the moment. If I remember right, there was for Mac as well as Windows.

Maybe someone else remembers more clearly ?

window groups
macoslib had some code for that

If I remember correctly the window group thing was a macOS Carbon thing.
I do have the Cocoa NSWindowMBS addChildWindow method in the plugins.
For Windows I don’t remember such a thing exists.

could be child windows
its a simple declare in any case

if in your project you have MacOSLib, then you may try the following method (included in MacOSLib) and set yourself left, top etc:

Sub AddChildWindowOrderedAbove(extends wParent as Window, wChild as Window)
//# Adds a given window as a child window of the window.

//@After the childWindow is added as a child of the window, it is maintained in relative position _
// indicated by orderingMode for subsequent ordering operations involving either window. _
// While this attachment is active, moving childWindow will not cause the window to move _
// (as in sliding a drawer in or out), but moving the window will cause childWindow to move.

//@Note that you should not create cycles between parent and child windows. _
// For example, you should not add window B as child of window A, then add window A as a child of window B.

//@This code will summon the ChildWindow but leaves it inactive. _
// You’ll still have to manually call the ChildWindow.Show method to ‘activate’ the ChildWindow.

#if TargetCocoa then
declare sub addChildWindow lib CocoaLib selector “addChildWindow:ordered:” (WindowRef As WindowPtr, ChildWindowRef as WindowPtr, OrderingMode as Integer)

addChildWindow wParent, wChild, 1

#else
#pragma Unused wParent
#pragma Unused wChild
#endif
End Sub

I have 2 ways of doing this.

One create a new window, read the top left and width and set the new window right next to the main. Then add whatever difference you want from the top.

newTop = window.top + 25 ’ so its 25 pixels lower than main
newLeft = window.left + window.width

on the new window create an Event Hnadler for Open and add

me.Top = newTop
me.left = newLeft

//////

A more cumbersome way but I kind of like thou its on the same window. Is to simply add width or height to your window and then simply go back to the original when closing. I use this method for some preferences that maybe often changed. But looks funny on the screen when programming.