Recent

Author Topic: MessageDialog window does not wait for user response  (Read 2825 times)

JanRoza

  • Hero Member
  • *****
  • Posts: 747
    • http://www.silentwings.nl
MessageDialog window does not wait for user response
« on: June 24, 2016, 01:49:29 pm »
I must be doing something wrong but i can't put my finger on it.
I use a msgdialog using the following code:

Code: Pascal  [Select][+][-]
  1. if MessageDlg('Update Information', strMessage, mtConfirmation, [mbYes, mbNo], 0) = mrYes
  2. then begin
  3. .....
  4. end;
  5.  

When running my program I see the message window appearing and just as quickly disappearing again without waiting for a user to select a button.
Any suggestions what am I missing?

I'm using Lazarus 1.7 (rev 51630) and FPC 3.0.0 under Windows 10 (64-bit)
OS: Windows 11 / Linux Mint 22.3
       Lazarus 4.6 RC FPC 3.2.2
       CodeTyphon 8.90 FPC 3.3.1

rvk

  • Hero Member
  • *****
  • Posts: 7042
Re: MessageDialog window does not wait for user response
« Reply #1 on: June 24, 2016, 01:58:20 pm »
Nope, should work fine (does for me in trunk 52006).

Maybe you can try this in a small new project and see if it's your Lazarus installation.
If it works in a small example you know it's your bigger program and the problem is elsewhere in your code.

(Maybe there is a keypress still in the buffer when reaching this dialog)

B.T.W. from what date is rev 51630 ? I see it skipping from 51625 to 51631 on sunday februari 14. Maybe time to update the version :)
« Last Edit: June 24, 2016, 02:01:44 pm by rvk »

JanRoza

  • Hero Member
  • *****
  • Posts: 747
    • http://www.silentwings.nl
Re: MessageDialog window does not wait for user response
« Reply #2 on: June 24, 2016, 06:11:43 pm »
Thanks rvk.
My Lazarus installation was compiled on 27 April this year.
I'll try a small project tonight and see what happens.

OS: Windows 11 / Linux Mint 22.3
       Lazarus 4.6 RC FPC 3.2.2
       CodeTyphon 8.90 FPC 3.3.1

JanRoza

  • Hero Member
  • *****
  • Posts: 747
    • http://www.silentwings.nl
Re: MessageDialog window does not wait for user response
« Reply #3 on: June 25, 2016, 01:05:49 am »
Did a test with a small new project and it works there so I went back to the original project and tried to find why it wouldn't work there.
I ended up with rewriting that part of the program so that no MessageDialog is needed anymore.
Okay, should have dug until I found the error but this solution was more economic.
So problem solved.
OS: Windows 11 / Linux Mint 22.3
       Lazarus 4.6 RC FPC 3.2.2
       CodeTyphon 8.90 FPC 3.3.1

 

TinyPortal © 2005-2018