Hello,
I have an old project showing a toolbar in a sheetWindow.
Running Xojo 2019r1, the sheetwindow does not show anymore the toolbar.
I tried setting the toolbar.top, height, width, visible, transparent etc., yet the toolbar does not show.
BTW: also a new project with window1 showing window2 (sheetWindow with a toolbar) does not show it.
Are you sure sheetwindows with toolbars were ever supported by the OS? I mean Xojo may have allowed it; but I dont recall actually seeing this in use elsewhere.
You may have to use a fake toolbar going forwards.
Seeing this thread, I checked my own projects for this issue. You’re true, 19r1 compiled projects (or in debugger as well) doesn’t show the toolbar in sheet windows.
Me, I also need to revise my projects with this issue showing up.
Would be straightforward just to change the window frame when possible.
Thats not necessarily true. When we updated from the 10.9 macOS SDK to 10.14 in 2018r4 there were several things that no longer worked properly. One thing that comes to mind which didnt make it into the r4 release was an issue with sheets which caused them to be translucent in dark mode. The solution was to bring them up to date, taking all of the OS changes from 10.9 through 10.14 into account. My suspicion is that Apple dropped this option somewhere over the last five years and were just seeing it now.
Im traveling to XDC today but if I have a chance to look at your case, Ill see what I can find.
Re-reading my comment; I think I came off a bit snobbish. That wasnt my intention and I have no desire to change the look and feel of your application, my personal feelings on this are that Apple may have never really supported this and now theyve changed something (probably for Marzipan) and that functionality has gone.
IMHO going forwards; you may want to look into faking a toolbar; or if your functionality is light enough; you could probably get away with using a SegmentedControl.
Ok, so I’ve looked into this and as I suspected the change we made which turned off the TitledWindow flag was necessary to have sheet windows to continue to be modal, opaque and able to have a background color under the macOS 10.14 SDK.
and maybe that is the correct configuration for them where the old one saying they were titled was wrong
hard to say for sure since the SDK changed so dramatically in between as well
So, since there is no way back and sheetwindows will not show toolbars, I keep what meanwhile I had done.
That is: the former sheetwindow becomes a Movable Modal, so that users cannot access (click, edit items etc.) the parent window.
theWindow.isMovable = false// so that it goes around with the parent
parent.AddChildWindowOrderedAbove(theWindow)
and then I set its top and left so that it shows just below the parent’s title and centered in the parent.
And of course, I tried hiding the title, but what happens is that the toolbar, although it remains visible, gets crippled, showing only the various buttons icons without their labels, and with no even space between the buttons. So, it is a no no. Title-bar is a must.
Emulate a toolbar is not a problem.
Anyway since I have to create an update for an app and this app need this feature I have to choose to remain with pre 2019 (strict budget to change unexpected things)
I will check if I can find a solution.
in any case you can create sheet window (no title) with toolbar in Xcode (modal). The problem here is relative to other Xojo feature, and I can understand this.
@Antonio Rinaldi [quote]Emulate a toolbar is not a problem.[/quote]
Agree, but it may take some time to have a toolbar that acts exactly as the built-in one.
At present I was thinking of a rudimentary one consisting of x canvases as background buttons ( lightgray when disabled and deeper gray when “pushed”), and to use pushbuttons (gradient) to display the images (via MacOSLib).