In Dark Mode, some of my buttons are invisible..

I updated the Xcode test to display the window modally: Test_modal.zip

Edit: Nobody has submitted a reproducible example project? Well… I wouldn’t expect you to be able to look into it in more detail then O_o

I tried modal window but can’t make it fail.

Here you are: <https://xojo.com/issue/53937>
This is similar to the issue in <https://xojo.com/issue/53541> (A default button that is initially disabled)
However, in this example/situation, the default button is NOT initially disabled.

Ok, so here’s my scenario that reproduces it. I’ll dig in more soon.

Default button that is disabled, on a page panel, in a container, on a movable modal. The only other elements on the page are three radio buttons, a cancel button, and a label.

Here I am about to reference my Beacon project again…
It’s reproducible 100% of the time using the SourceActionButton object of DocumentImportView. The window has a workaround of just not setting default to true, so if you choose to use this to test against, set that button’s default property first.

Correction, disabled on a page panel, in a container, on a document window that is not shown modally.

Tim would love to see the source to your Xcode app… unfortuanlty I can’t run it since it rquires Mojave

I have been unable to make any progress with a simple project to demonstrate the issue. I’ve setup a window very similar to Beacon’s, but… it just works. I don’t know what the magic is that makes the button disappear.

Ok, downloaded Jürg sample,

  • remote debug to Mojave Dark Mode in Paralles it shows the button

  • close the modal and go to light mode, it shows the button

  • close the modal and go to dark mode, it doesn’t show the button

  • remote debug to Mojave Dark Mode using Macbook Air, it doesn’t show the button

Mojave version used 10.14

Well, it’s small enough to fit here :stuck_out_tongue:

[code]// AppDelegate.m
#import “AppDelegate.h”

@implementation AppDelegate

  • (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    // Insert code here to initialize your application
    [NSApp runModalForWindow:_winMain];
    }

  • (void)applicationWillTerminate:(NSNotification *)aNotification {
    // Insert code here to tear down your application
    }

@end
[/code]

winMain checkbox for “Visible at launch” is disabled.
The only button on the window is default and disabled using inspector properties.

ok… I thought you had some dark mode specific code

Nope, and that’s the point of the test. I’m trying to ascertain whether the failure is Xojo’s or Apple’s because we don’t know much about what Xojo did inside the framework for dark mode - but with all the issues we keep seeing it seems like a hack.

Window2 open event has this code (Jürg’s sample):

self.Height = me.TextArea1.Top + me.TextArea1.Height + 50

if I comment that then the button shows Dark Mode Mojave on Macbook Air

I put the code outside the Open Event and in a Mouse Over event. The modal window resizes with the default button. Then I tried:

Xojo.Core.Timer.CallLater (0, AddressOf ChangeSize)

with the line of code in ChangeSize and it also works (it shows the default button)

Hope this helps.

Edit: I did the tests to learn and find why I can see the default button on my sample and not with Jürg’s sample. The idea was not to find another workaround but to give more information, that way I hope Xojo can find a way to make it work and fix this issue.

There are a couple of possible workarounds, yes.
The goal of this example was simply to show a situation with “default button not showing” that used to work in LightMode, but doesn’t in DarkMode.
So one possible cause for “not visible default buttons” is that the Layout gets initialized (according to LayoutEditor), but then is being resized before shown.

@Greg O’Lone : I just noticed that you’ve fixed <https://xojo.com/issue/53541>. We’re curious to know what has been the issue you could “fix” via Framework?

Is this actually a PushButton, BevelButton or PictureButton?

Unfortunately this is not something you can use a declare to get around.