Recent

Author Topic: Cant interact with Main Form of my project  (Read 514 times)

Froxter

  • Newbie
  • Posts: 1
Cant interact with Main Form of my project
« on: October 09, 2024, 04:14:29 pm »
When I execute my project and the main form creates it does in Modal, basically it is over everything and I cant interact with nothing because it just is locked.

Specifically imagine a settings form of you project, you set it in modal, well there is not another form in my project and it is not seted as modal

P.D: Im really sorry to not proivide code or more information, I deleted the project due frustration before. Luckily it just was a test
« Last Edit: October 09, 2024, 06:53:38 pm by Froxter »

cdbc

  • Hero Member
  • *****
  • Posts: 1644
    • http://www.cdbc.dk
Re: Cant interact with Main Form of my project
« Reply #1 on: October 09, 2024, 05:12:24 pm »
Hi
Show us the code...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

MarkMLl

  • Hero Member
  • *****
  • Posts: 7999
Re: Cant interact with Main Form of my project
« Reply #2 on: October 09, 2024, 05:24:18 pm »
You've almost certainly got a tight loop in your main thread, so control is never being passed back to the GUI to keep the form live.

You will need to either work out how to move your computations to a background thread, or to call Application.ProcessMessages every few iterations.

More than that we can't say, because you haven't provided example code, haven't told us what OS you're using, haven't told us what version of Lazarus you're using, haven't told us what version of FPC you're using...

If you isolate the problem and post any code fragments (i.e. rather than appending a .zip etc. to a message), please note the button marked # above the editing pane. If you don't use that to markup your code then important details will get lost since any time the forum software sees [ it will interpret (and remove it) as a formatting tag.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1198
Re: Cant interact with Main Form of my project
« Reply #3 on: October 10, 2024, 12:52:14 am »
When I execute my project and the main form creates it does in Modal, basically it is over everything and I cant interact with nothing because it just is locked.

Specifically imagine a settings form of you project, you set it in modal, well there is not another form in my project and it is not seted as modal

P.D: Im really sorry to not proivide code or more information, I deleted the project due frustration before. Luckily it just was a test

You will need to create a new project and share information IF you’re serious about wanting help  :D
1p1der
« Last Edit: October 11, 2024, 11:50:08 am by Joanna »
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

Thaddy

  • Hero Member
  • *****
  • Posts: 16138
  • Censorship about opinions does not belong here.
Re: Cant interact with Main Form of my project
« Reply #4 on: October 10, 2024, 06:59:57 am »
You can interact, but it is probaly not very wise to have a modal dialog on top.
The mainform will accept any messages, though, but the modal dialog will stay until you close it.
probably a misuse of modal or not understanding modal.
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018