Lazarus

Programming => Widgetset => Cocoa => Topic started by: VTwin on December 03, 2018, 11:10:43 pm

Title: [SOLVED] ListBox ItemIndex does not deselect previous selection
Post by: VTwin on December 03, 2018, 11:10:43 pm
Setting ListBox ItemIndex does not deselect the previous selection, when MultiSelect = false. Project attached.

I'd appreciate a confirmation before posting a bug report.

Thanks,
VTwin
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: Hansaplast on December 03, 2018, 11:21:16 pm
Just compiled and tested your example project.
It works correctly on my Mac, setting ItemIndex does correctly deselects previous selected row.


I'm running Lazarus from trunk (Lazarus 2.1.0 r59719 FPC 3.0.4 x86_64-darwin-cocoa (alpha), macOS 10.14.1).
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: sash on December 03, 2018, 11:33:23 pm
Linux gtk2, xfce. Works as intended.
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: VTwin on December 04, 2018, 07:09:17 pm
Many thanks! Apparently the fix has been made. I was using the latest 2.0 svn. I just checked the 2.1 trunk and, yes it does work. No need to report it. 

I need to build cocoa applications and want the latest stable version, with cocoa fixes. Can anyone explain at what point cocoa fixes are merged? Once the stable 2.0 is released will cocoa fixes be available by svn?



Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: VTwin on December 04, 2018, 07:35:46 pm
@Hansaplast

I just tried updating 2.1 to 59727 and it fails. Have you tried?

Code: Pascal  [Select][+][-]
  1. /Developer/laz_trunk/packager/fppkghelper.pas(131,19) Error: (5000) Identifier not found "FFPpkg"
  2. /Developer/laz_trunk/packager/fppkghelper.pas(131,51) Error: (5000) Identifier not found "pkgpkInstalled"
  3. /Developer/laz_trunk/packager/fppkghelper.pas(132,26) Error: (5038) identifier idents no member "PackagesStructure"
  4. fppkghelper.pas(138) Fatal: (10026) There were 3 errors compiling module, stopping
  5. Fatal: (1018) Compilation aborted
  6. make[2]: *** [lazbuild] Error 1
  7. make[1]: *** [lazbuilder] Error 2
  8. make: *** [lazbuild] Error 2
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: Hansaplast on December 04, 2018, 07:51:26 pm
@VTwin;


Yep, I just did and SVN update and recompiled ending up with the same error messages.
I did do a clean all as well. Sometimes I get lucky by removing it all and doing a fresh full trunc download. I'll give that a try now ... I'll report back if that worked.



Code: Pascal  [Select][+][-]
  1. /Users/hans/freepascal/lazarus/packager/fppkghelper.pas(131,19) Error: (5000) Identifier not found "FFPpkg"
  2. /Users/hans/freepascal/lazarus/packager/fppkghelper.pas(131,51) Error: (5000) Identifier not found "pkgpkInstalled"
  3. /Users/hans/freepascal/lazarus/packager/fppkghelper.pas(132,26) Error: (5038) identifier idents no member "PackagesStructure"
  4. fppkghelper.pas(138) Fatal: (10026) There were 3 errors compiling module, stopping
  5. Fatal: (1018) Compilation aborted
  6. make[2]: *** [lazbuild] Error 1
  7. make[1]: *** [lazbuilder] Error 2
  8. make: *** [lazbuild] Error 2
  9.  

Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: VTwin on December 04, 2018, 07:57:25 pm
Thanks.

I just updated to 2.0.0RC2 v59727. The bug is still there. So I assume it will not be fixed in the next stable release 2.0.0. So, do I report it?
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: Hansaplast on December 04, 2018, 07:58:07 pm
@VTwin; completely removing, downloading it all and compiling just produced the same error.
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: Hansaplast on December 04, 2018, 07:59:14 pm
Honestly; I'm always asking that same question. But ... since you found confirmation in the forum, you may want to report it as a bug yes.
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: Hansaplast on December 04, 2018, 08:05:18 pm
I just went back to the previous version I used with


Code: Pascal  [Select][+][-]
  1. svn update -r r59719
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: VTwin on December 04, 2018, 08:24:21 pm
Excellent. Thanks for the confirmation and your solution.

I posted the question in the 2.0.0RC2 thread, maybe one of the developers will answer. I'm unclear on the process, but it would be a shame if cocoa fixes don't make it into 2.0.0.
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: Hansaplast on December 04, 2018, 09:07:31 pm
I tested all trunk versions from r59727 down to r59719 - it looks like the bug was introduced in r59720.
I'm sure the devs would like to know that.
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: VTwin on December 05, 2018, 02:46:59 am
Good sleuthing. Are you going to submit this?
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: Hansaplast on December 05, 2018, 04:46:55 pm
Haha, I thought you had already reported it.
No worries ... just reported it in Bugtracker that the IDE cannot be compiled: 0034652 (https://bugs.freepascal.org/view.php?id=34652)


I just tested r59729 under Windows, MacOS and Linux.
As expected; they all failed.  :o
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: VTwin on December 06, 2018, 02:46:57 pm
Haha, I thought you had already reported it.
No worries ... just reported it in Bugtracker that the IDE cannot be compiled: 0034652 (https://bugs.freepascal.org/view.php?id=34652)


I just tested r59729 under Windows, MacOS and Linux.
As expected; they all failed.  :o

Thanks, no I was too focused on the 2.0.0RC2 release, but would have if you had not. Can't build on all platforms!? Wow, hard to see how that could slip through.

No answers posted in the RC2 thread. I'm happy to test for bugs on 2.1 svn, but I'm reluctant to use it for a release until it is stable. I put out one cocoa release using 2.1 and discovered that it was acting strangely, forms not appearing.

Maybe cocoa bugs like this will not be fixed in a stable release until 2.2.0? Anyway, it is good to see such rapid progress in cocoa.

Not sure what to do though. Releasing a carbon 32 bit version as well does not look very professional. :(

Cheers,
VTwin
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: Hansaplast on December 06, 2018, 03:24:18 pm
The bug (in trunk) has been resolved - woohoo - thanks to the folks involved.  :)


For my own applications I do use Cocoa (SVN trunk) for releasing, and have to say that it's pretty stable. You just have to keep in mind that a few minor things may or may not change while it's still in development.
Here is one of my applications (https://www.tweaking4all.com/home-theatre/rename-my-tv-series-v2/) in case you'd like to take a peek and test stability. I suppose there will always be minor differences between widget-sets, so I did have to make a few exceptions in code to catch those (if you develop multi platform).


I moved away from Carbon because I did get too many complaints about the 32-bit warning and I wanted to sign the application. On top of that: developing with Cocoa from trunk will help identify issues which then hopefully will get resolved. For example, I ran into a TrayIcon issue (this post (http://forum.lazarus-ide.org/index.php/topic,43328.0.html)), and hope someone can resolve it or assist in resolving it.
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: VTwin on December 06, 2018, 05:03:02 pm
Excellent!  :D

Thanks for your input. Yes, cocoa fixes are still showing up rapidly in svn trunk. That is probably a good enough reason to use it for a release, and say sayonara to carbon. I'll stick with the latest stable release for Win 64 and Lin 64, which I run on VirtualBox.

Very nice website. I just added a PayPal donate button to my site. I see you have some interesting alternatives, do you have any pros or cons to report? I'll pm you a link to my site.
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: VTwin on December 06, 2018, 05:11:15 pm
Getting off topic, but I'm curious about your experience with code signing. I've been told I should do it. At the moment I'm providing sha256 sums in case anyone wants to verify the download is not tampered with.
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: Hansaplast on December 06, 2018, 06:29:59 pm
I did reply to your PM, so we don't go too far off topic.  :D


As for signing;


MacOS: I have got this kinda under control now, even though it's not always "easy".
I tried using sandboxing, but I keep running into issues, so I sign my applications without sandboxing (for now anyway - since the sandboxing idea may not be all that bad after-all).
These days, as a developer that is not using the Apple App Store, you can get a cert for free. You have to register as a developer though, but as I understand you do not need to pay (my payed one just expired and I'm not renewing this until I put something in the app store).
So I sign to have the users not see the message about unsigned applications, and have firewalls like Little Snitch not block network traffic because of that.


I'll PM you with the details on how I sign my apps.


Windows: I'm not signing anything here yet - getting a cert is just too expensive. But ... since Microsoft mimics Apple ideas, this will be unavoidable in the future.
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: VTwin on December 07, 2018, 01:28:48 am
Wow, thanks. I'm pretty old school, just trying help out my colleagues with scientific software. I'm glad I don't have to make a living coding. Good to know I might get an Apple cert for free, I thought it was $100 per year.

Apple has becoming increasingly hostile to small developers. My users are about 20% Mac, 20% Linux, 60% Windows. I suppose I'll wade through the muck for a while, see what I can do to comply.

Perhaps Lazarus devs will come up with some tools for certification. I used to use REALbasic (now Xojo) which apparently has some tools for that, but otherwise I could never recommend.

Cheers,
VTwin


 
Title: Re: ListBox ItemIndex does not deselect previous selection
Post by: Hansaplast on December 07, 2018, 04:29:48 pm
I guess I'm old school as well haha ... and equally glad I do not have to code for a living. Even though I used to be managing quite a few large development projects (Delphi based).


Couldn't agree more; Apple appears to become more and more hostile towards small developers. But ... Microsoft is going the same route, just with a higher price tag (for signing apps).


I actually did an attempt to create a tool to "finish" my projects (plist, sandbox, signing, make DMG) but it's not even remotely close to finished. I recall CCRDude making something like this as well (this post (http://forum.lazarus-ide.org/index.php/topic,43280.0.html)).
TinyPortal © 2005-2018