Recent

Author Topic: [SOLVED] Application fullscreen  (Read 456 times)

Pe3s

  • Hero Member
  • *****
  • Posts: 533
[SOLVED] Application fullscreen
« on: March 12, 2023, 11:45:03 am »
Hello, I have a question about the full screen code, why when I return to the normal screen, the application window disappears for a while and then reappears? Can I improve it?
« Last Edit: March 12, 2023, 07:55:05 pm by Pe3s »

KoBraSoft

  • New Member
  • *
  • Posts: 20
Re: Application fullscreen
« Reply #1 on: March 12, 2023, 01:03:15 pm »
Hello,
your sample application does not work on my System (Xubuntu 22.04.2 LTS 64 bit, Lazarus 2.2.4 FPC 3.2.2 x86_64-linux-gtk2).
After click on button1 the Window disappear.

I usually use
Code: Pascal  [Select][+][-]
  1. Form1.WindowState:=wsFullScreen;
to switch to full screen.

I also prefer the use of ActionList1. See attached example.

PS
My first Idea
Code: Pascal  [Select][+][-]
  1.   private
  2.     FullScrn : boolean;
  3. ...
  4. procedure TForm1.Action1Execute(Sender: TObject);
  5. begin
  6.    if FullScrn then Form1.WindowState:=wsNormal
  7.    else
  8.      Form1.WindowState:=wsFullScreen;
  9.    FullScrn := not FullScrn;  

did not work well. I had to call Action1Execute three times to  switch back to normal Screen
Code: Pascal  [Select][+][-]
  1.   private
  2.     FullScrn : boolean;
  3. ...
  4. procedure TForm1.Action1Execute(Sender: TObject);
  5. begin
  6.   Form1.WindowState:=wsFullScreen;
  7.   if FullScrn then Form1.WindowState:=wsNormal;
  8.   FullScrn := not FullScrn;  

 

Pe3s

  • Hero Member
  • *****
  • Posts: 533
Re: Application fullscreen
« Reply #2 on: March 12, 2023, 07:54:50 pm »
Thank you  :)

 

TinyPortal © 2005-2018