Sheet window disappears when app minimised

Hi all.
I have an app with a window that opens. On the got focus of a textfield, it checks to see if a property is true (user logged in). If false, it calls a sheet window with a login screen that changes that property to true once logged in.

If the sheet screen is open and the app is minimised, once restored, the sheet window has disappeared.

Is there a way to keep it open during minimise?

Cheers
Andrew

[quote=162957:@Andrew Willyan]Hi all.
I have an app with a window that opens. On the got focus of a textfield, it checks to see if a property is true (user logged in). If false, it calls a sheet window with a login screen that changes that property to true once logged in.

If the sheet screen is open and the app is minimised, once restored, the sheet window has disappeared.

Is there a way to keep it open during minimise? [/quote]

You could set a flag when you display it, and redisplay it in activate that occurs when the application is restored.

I can’t reproduce the behavior.
Project File

So have you checked over all of your code to see if something may be closing the sheet?
Misinterpreted input, assumed values, using a textfield.focus event, many things.

I would have checked if the user was logged in before even displaying the window with the text field.

Actually, it should be impossible to minimize the window when the login screen is displayed. And it should be modal.

On Mac we let the user decide what’s important. Windows with sheets can be minimized because that app may not be the most important thing on the screen.

The sheet blocks access to the rest of the window, so it does behave modally.

The only thing I can think of is that the sheet window does not have a parent. It displays ‘attempting to run sheet without a parent’ in the messages at debug run time. Although it runs fine, perhaps this is the problem?

I don’t know how to set the parent?

Do you use ShowModalWithin?

http://documentation.xojo.com/index.php/Window.ShowModalWithin

I dont, I just do window.show
I was worried about displaying a sheet window with the showmodalwithin as it states OS X only. I want to make this mac mainly, but pc also.

Cheers

[quote=162990:@Andrew Willyan]I dont, I just do window.show
I was worried about displaying a sheet window with the showmodalwithin as it states OS X only. I want to make this mac mainly, but pc also.

Cheers[/quote]
On the main Window doc:

It’ll work fine on Windows :slight_smile:

ShowModal seems to work fine for me on Windows, and does not exhibit this behavior.

Ok. Thanks guys. Will give showmodalwithin a go.

On a side note, how do you check how your app looks on windows if developed on mac?

I do have windows running in parallels. The only way I could think of is to install xojo on windows, copy the source code over and run it.

I can’t build it as I currently don’t have a license. It has expired and don’t wish to renew it until I have finished development.

Cheers.

If you’re running Parallels you can set up remote testing.
I do not have Parallels, I have to Boot Camp into Windows where I have a Xojo install.

I would recommend against testing with CrossOver - it didn’t work out too well for me.

Great. Thanks. Will Google remote testing and see if I can get it going.

I used to boot camp but parallels is so easy and works perfectly. As long as you don’t mind giving up a gig of ram for it to use while windows is running (never been an issue for me).

Cross over is an emulator which never give great results. Parallels actually runs windows. The great thing for me is I have xp, win 7 and 8 all running without having to restart which is great for testing.

Cheers.

[quote=163004:@Tim Parnell]If you’re running Parallels you can set up remote testing.
I do not have Parallels, I have to Boot Camp into Windows where I have a Xojo install.

I would recommend against testing with CrossOver - it didn’t work out too well for me.[/quote]

You should get VirtualBox. It is really neat. And free.

I picked up a cheap Windows laptop just for testing on. I wish I hadn’t as it’s a POS.

i used VirtualBox with Mountain Lion and many version of Window and even linux mint

Windows does require some oomph to feel comfortable. I usually go for the fastest gamer desktop machine I can get for development.

But to make sure your app performs adequately on average Joe’s machine, what you got now is probably just what you need. A lot of end user laptops today have processors around 1.5 GHz.

last time i try on Lenovo Thinkpad tablet with 2GB RAM and it does not run at all…

we got a lenovo yoga 2 recently with 4 GB RAM and it work fine.

[quote=163061:@Richard Duke]last time i try on Lenovo Thinkpad tablet with 2GB RAM and it does not run at all…
[/quote]

Looks like some incompatibility, possibly in the code more than Xojo itself. Have you tried running a sample app with nothing in it ?

not Xojo IDE… just the app i build with xojo and it is the same application.