Recent

Author Topic: Laz 2.0RCL2/Cocoa: form calling showmodal has incorrect visibility  (Read 3479 times)

bigDan

  • New Member
  • *
  • Posts: 43
    • BigDanzBlog
I am porting a program from windows to macintosh. I have little experience with Macintosh but 99.9% of the port has went w/o issue. One of the last issues deals with modal forms not working as they do in windows/linux.

In my sample code I have mainform and loginform. in mainform.activate, loginform.showmodal is called.

In windows, mainform is displayed, then loginform is displayed on top of that as one would expect.

In Mac, only loginform shows but if anything in loginform is clicked (the form itself or the combobox), then mainform is displayed behind loginform.

I actually want mainform to be hidden when loginform is displayed. If I put self.hide before loginform.showmodal, the same effect occurs. mainform is initially hidden, but clicking on anything in loginform causes mainform to be displayed.

In windows, I get the effect I need: loginform is displayed by itself. When the button is clicked, it is closed and mainform is displayed.

I've searched the forum, the bug tracker, and the 'net and not been able to find anyone discussing this issue. I've tried playing with all the various form settings and nothing I've tried allows the mac version to act properly.

Does any one have any ideas what may be wrong?

Thanks,

bigDan

I'm using Lazarus 2.0RCL2/Cocoa/64bit, compiling on an El Capitan system.
« Last Edit: November 17, 2018, 07:55:03 am by bigDan »

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: Laz 2.0RCL2/Cocoa: form calling showmodal has incorrect visibility
« Reply #1 on: November 17, 2018, 10:55:13 am »
I just tested your project with the latest SVN version (macOS Mojave 10.14.1, Lazarus 2.1.0 r59566M FPC 3.0.4 x86_64-darwin-cocoa (alpha)) and noticed this;


1) When starting from the Lazarus IDE (debugger set to "none", default profile)


Both forms are visible right away. I don't even have to click anywhere.


2) When starting the executable from Terminal (project1)


Both forms show right away as well (same as when running from the IDE).


3) When starting (project1.app) the application straight from the Finder


Login form shows, click anywhere (except the button) and nothing happens, just the login form remains visible.
Click the button, and the login form disappears and the mainform shows.






Not sure if this is helpful, but it sounds like a bug to me ... maybe report this in bug tracker?

bigDan

  • New Member
  • *
  • Posts: 43
    • BigDanzBlog
Re: Laz 2.0RCL2/Cocoa: form calling showmodal has incorrect visibility
« Reply #2 on: November 18, 2018, 09:41:15 pm »
I got qt5 up and running and it doesn't have the issue. Short term, I will use qt5.

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: Laz 2.0RCL2/Cocoa: form calling showmodal has incorrect visibility
« Reply #3 on: November 20, 2018, 09:48:23 pm »
Please submit this as a bug report.

I was just working today with a group of people explaining the use of my software, and one person using Mohave was getting strange behavior with certain forms not appearing. The software was built using Lazarus trunk with cocoa. The software does not show this behavior on El Capitan.

The cocoa widgetset is rapidly improving, but bug reports are essential to the process.

Cheers,
VTwin
« Last Edit: November 20, 2018, 09:50:27 pm by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

bigDan

  • New Member
  • *
  • Posts: 43
    • BigDanzBlog

 

TinyPortal © 2005-2018