Lazarus

Programming => Operating Systems => macOS / Mac OS X => Topic started by: Espectr0 on March 29, 2023, 09:40:52 pm

Title: [Solved] Fullscreen event?
Post by: Espectr0 on March 29, 2023, 09:40:52 pm
Hola,

In my App, how can I detect when it enters or leaves fullscreen mode?


Thanks!
Title: Re: Fullscreen event?
Post by: KodeZwerg on March 29, 2023, 10:33:58 pm
By setting for form a OnWindowStateChange Handler and determine current status?
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormWindowStateChange(Sender: TObject);
  2. begin
  3.   if WindowState in [wsFullScreen,wsMaximized] then
  4.     Self.Caption := 'Full'
  5.     else
  6.     Self.Caption := 'Basic';
  7. end;
Title: Re: Fullscreen event?
Post by: KodeZwerg on March 31, 2023, 12:17:27 am
Is it solved?
Title: Re: Fullscreen event?
Post by: Espectr0 on March 31, 2023, 11:12:47 am
@KodeZwerg Sorry for the delay, I haven't tried it yet, this weekend I'll try and comment here...
but just in case I ask you: is the "windowstatechange" event executed before the switch or after (talking of macos)?

Thanks
Title: Re: Fullscreen event?
Post by: KodeZwerg on March 31, 2023, 01:45:21 pm
It is triggered when the WindowState change. (eg: User maximize the form)
I have to admit that I do not use MacOS, I am on Windows, but the way about "how-to" should be the same.
TinyPortal © 2005-2018